Commit d435bee2547b82e41c8a79466521b8585fe8e372

Authored by Yarik
2 parents 8467c8d3 cf039359

Merge remote-tracking branch 'origin/master'

common/config/main.php
@@ -9,7 +9,7 @@ return [ @@ -9,7 +9,7 @@ return [
9 ], 9 ],
10 'components' => [ 10 'components' => [
11 'cache' => [ 11 'cache' => [
12 - 'class' => 'yii\caching\DummyCache', 12 + 'class' => 'yii\caching\MemCache',
13 'keyPrefix' => 'linija_' 13 'keyPrefix' => 'linija_'
14 ], 14 ],
15 'sms' => [ 15 'sms' => [
common/modules/product/models/Import.php
@@ -164,6 +164,15 @@ @@ -164,6 +164,15 @@
164 // ===== Set stock ==== 164 // ===== Set stock ====
165 if (!$city_name) { 165 if (!$city_name) {
166 if (!$count) { 166 if (!$count) {
  167 + $productVariant->status = 0;
  168 + if ($price_promo) {
  169 + $productVariant->price_old = $price;
  170 + $productVariant->price = $price_promo;
  171 + } else {
  172 + $productVariant->price = $price;
  173 + $productVariant->price_old = $price_promo;
  174 + }
  175 + $productVariant->save(false, ['status', 'price', 'price_promo']);
167 continue; 176 continue;
168 } 177 }
169 $city_name = 'Склад'; 178 $city_name = 'Склад';
common/modules/product/widgets/views/product_smart.php
@@ -43,9 +43,13 @@ @@ -43,9 +43,13 @@
43 'product' => $product->alias 43 'product' => $product->alias
44 ]) ?>" title="<?= $product->fullname . ' ' . $product->category->name ?>"> 44 ]) ?>" title="<?= $product->fullname . ' ' . $product->category->name ?>">
45 45
46 - <p><span><?= $product->name ?></span></p>  
47 -<!-- <p><span>--><?//= $product->fullname ?><!--</span></p>-->  
48 -<!-- <p><span>--><?//= $product->category->name ?><!--</span></p>--> 46 + <p><span><?= $product->fullName ?></span></p>
  47 + <?php
  48 + /*
  49 + <p><span><?= $product->fullname ?></span></p>
  50 + <p><span><?= $product->category->name ?></span></p>
  51 + */
  52 + ?>
49 </a> 53 </a>
50 54
51 </div> 55 </div>
common/modules/product/widgets/views/product_smart_similar.php
@@ -36,8 +36,8 @@ @@ -36,8 +36,8 @@
36 $product->imageUrl, 36 $product->imageUrl,
37 'list', 37 'list',
38 [ 38 [
39 - 'alt' => $product->name,  
40 - 'title' => $product->name, 39 + 'alt' => $product->getFullName(),
  40 + 'title' => $product->getFullName(),
41 'class' => 'selected', 41 'class' => 'selected',
42 'itemprop' => 'image', 42 'itemprop' => 'image',
43 ] 43 ]
@@ -50,9 +50,9 @@ @@ -50,9 +50,9 @@
50 <a href="<?= Url::to([ 50 <a href="<?= Url::to([
51 'catalog/product', 51 'catalog/product',
52 'product' => $product->alias 52 'product' => $product->alias
53 - ]) ?>" title="<?= $product->fullname . ' ' . $product->category->name ?>"> 53 + ]) ?>" title="<?= $product->fullname ?>">
54 <!-- <p><span>--><?php //echo $product->category->name ?><!--</span></p>--> 54 <!-- <p><span>--><?php //echo $product->category->name ?><!--</span></p>-->
55 - <p><span><?= $product->name ?></span></p> 55 + <p><span><?= $product->fullName ?></span></p>
56 56
57 </a> 57 </a>
58 58
frontend/controllers/AjaxController.php
@@ -93,8 +93,8 @@ class AjaxController extends Controller @@ -93,8 +93,8 @@ class AjaxController extends Controller
93 $query->select(['product.*']); 93 $query->select(['product.*']);
94 $query->joinWith(['enabledVariants','brand','options', 'category']); 94 $query->joinWith(['enabledVariants','brand','options', 'category']);
95 95
96 -// $query->groupBy(['product.product_id', 'product_variant.price']);  
97 - 96 + $query->groupBy(['product.product_id', 'product_variant.price']);
  97 +
98 ProductHelper::_setQueryParams($query, $params); 98 ProductHelper::_setQueryParams($query, $params);
99 99
100 $query->andWhere(['!=', ProductVariant::tableName() .'.status', 1]); 100 $query->andWhere(['!=', ProductVariant::tableName() .'.status', 1]);
frontend/controllers/SiteController.php
@@ -263,7 +263,10 @@ class SiteController extends Controller @@ -263,7 +263,10 @@ class SiteController extends Controller
263 263
264 foreach ($products as $product) 264 foreach ($products as $product)
265 { 265 {
266 - 266 + /**
  267 + * Fix for emty brands 14.03.2017
  268 + */
  269 + if (empty($product->brand)) continue;
267 270
268 print "<item>"; 271 print "<item>";
269 print "<id>" . htmlspecialchars($product->variant->product_variant_id) . "</id>"; 272 print "<id>" . htmlspecialchars($product->variant->product_variant_id) . "</id>";
frontend/views/catalog/_product_item.php
@@ -39,8 +39,8 @@ use yii\helpers\Url; @@ -39,8 +39,8 @@ use yii\helpers\Url;
39 39
40 </div> 40 </div>
41 <?= \common\components\artboximage\ArtboxImageHelper::getImage($model->imageUrl, 'list', [ 41 <?= \common\components\artboximage\ArtboxImageHelper::getImage($model->imageUrl, 'list', [
42 - 'alt' => $model->category->name . ' ' . $model->name,  
43 - 'title' => $model->category->name . ' ' . $model->name, 42 + 'alt' => $model->getFullName(),
  43 + 'title' => $model->getFullName(),
44 'class' => 'selected', 44 'class' => 'selected',
45 'itemprop' => 'image' 45 'itemprop' => 'image'
46 ]) ?> 46 ]) ?>
frontend/views/catalog/product.php
@@ -25,8 +25,9 @@ @@ -25,8 +25,9 @@
25 $this->params[ 'seo' ][ Seo::TITLE ] = $product->fullname .' купить в Киеве, Украине недорого - Лінія Світла'; 25 $this->params[ 'seo' ][ Seo::TITLE ] = $product->fullname .' купить в Киеве, Украине недорого - Лінія Світла';
26 $this->params[ 'seo' ][ 'fields' ][ 'name' ] = $product->fullname; 26 $this->params[ 'seo' ][ 'fields' ][ 'name' ] = $product->fullname;
27 $this->params[ 'seo' ][ 'h1' ] = $product->fullname; 27 $this->params[ 'seo' ][ 'h1' ] = $product->fullname;
28 -  
29 - 28 + $this->params[ 'seo' ][ 'key' ] = $product->category->name;
  29 +
  30 +
30 $this->params[ 'breadcrumbs' ][] = [ 31 $this->params[ 'breadcrumbs' ][] = [
31 'label' => $category->name, 32 'label' => $category->name,
32 'url' => [ 33 'url' => [
@@ -73,8 +74,8 @@ @@ -73,8 +74,8 @@
73 <?php else : ?> 74 <?php else : ?>
74 <a href="<?= $product->imageUrl ?>" data-lightbox="image-1" data-title="<?= $product->fullname;?>"> 75 <a href="<?= $product->imageUrl ?>" data-lightbox="image-1" data-title="<?= $product->fullname;?>">
75 <?= ArtboxImageHelper::getImage($product->imageUrl, 'product_show',[ 76 <?= ArtboxImageHelper::getImage($product->imageUrl, 'product_show',[
76 - 'alt'=>$product->fullname." фото 1" ,  
77 - 'title' => $product->fullname." фото 1", 77 + 'alt'=>$product->fullname,
  78 + 'title' => $product->fullname,
78 'itemprop' => 'image' 79 'itemprop' => 'image'
79 ]) ?> 80 ]) ?>
80 </a> 81 </a>
@@ -514,7 +515,7 @@ @@ -514,7 +515,7 @@
514 <td class="value"> 515 <td class="value">
515 <?php 516 <?php
516 foreach($group->_options as $option) { 517 foreach($group->_options as $option) {
517 - if ($group->is_filter) { 518 + if ($group->is_filter && preg_match("/^.*(назначение|подразделы|стиль|тип\sисточника|тип\sнастенного|тип\sпотолочного|вид|тип\sлампочки|тип\sуличного|тип\sточечного).*$/iu", $group->name)) {
518 echo Html::a('&nbsp;' . $option->ValueRenderHTML, 519 echo Html::a('&nbsp;' . $option->ValueRenderHTML,
519 [ 520 [
520 'catalog/category', 521 'catalog/category',
frontend/views/catalog/products.php
@@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
81 81
82 <!----------------- Banner ventolux -------------------> 82 <!----------------- Banner ventolux ------------------->
83 <div style="width: 95%; overflow: hidden; margin-top: 10px;" > 83 <div style="width: 95%; overflow: hidden; margin-top: 10px;" >
84 - <a href="http://ventolux.ua/" target="_blank"><img style="width: 100%;" src="/storage/banner/ventolux1.jpg" alt="ventolux" /></a> 84 + <a rel="nofollow" href="http://ventolux.ua/" target="_blank"><img style="width: 100%;" src="/storage/banner/ventolux1.jpg" alt="ventolux" /></a>
85 </div> 85 </div>
86 86
87 </div> 87 </div>
frontend/web/css/css_header.css
@@ -20398,7 +20398,7 @@ vertical-align: top @@ -20398,7 +20398,7 @@ vertical-align: top
20398 20398
20399 .sub-cat_ ul li { 20399 .sub-cat_ ul li {
20400 border: 0!important; 20400 border: 0!important;
20401 -height: 180px!important; 20401 +height: 188px!important;
20402 position: relative; 20402 position: relative;
20403 margin-top: 20px!important 20403 margin-top: 20px!important
20404 } 20404 }
@@ -20455,7 +20455,7 @@ color: #0f6fc7; @@ -20455,7 +20455,7 @@ color: #0f6fc7;
20455 font-size: 14px; 20455 font-size: 14px;
20456 line-height: normal; 20456 line-height: normal;
20457 text-align: center; 20457 text-align: center;
20458 -height: 34px; 20458 +height: 66px;
20459 overflow: hidden; 20459 overflow: hidden;
20460 margin-top: 10px 20460 margin-top: 10px
20461 } 20461 }
frontend/widgets/Seo.php
@@ -293,24 +293,22 @@ class Seo extends Widget @@ -293,24 +293,22 @@ class Seo extends Widget
293 293
294 $widgetData = static::findSeoByUrl($this->url); 294 $widgetData = static::findSeoByUrl($this->url);
295 295
  296 + $seoDynamicData = $this->findSeoByDynamic();
  297 +
296 if ($widgetData instanceof \common\models\Seo) { 298 if ($widgetData instanceof \common\models\Seo) {
297 299
298 $result = $widgetData->$param; 300 $result = $widgetData->$param;
299 - 301 +
  302 + } else if ($seoDynamicData instanceof SeoDynamic) {
  303 +
  304 + $result = $seoDynamicData->$param;
  305 +
300 } else if (!empty($this->$param)) { 306 } else if (!empty($this->$param)) {
301 307
302 $result = $this->$param; 308 $result = $this->$param;
303 309
304 } else { 310 } else {
305 -  
306 - $widgetData = $this->findSeoByDynamic();  
307 -  
308 - if ($widgetData instanceof SeoDynamic) {  
309 -  
310 - $result = $widgetData->$param;  
311 -  
312 - }  
313 - 311 + $result = '';
314 } 312 }
315 313
316 return $this->replaceData($result); 314 return $this->replaceData($result);