Commit f3f8709d60ff2edafb6ef189aeae50829a0b3346

Authored by Administrator
1 parent d16d91c3

big commti

common/modules/product/models/Import.php
@@ -75,6 +75,12 @@ class Import extends Model { @@ -75,6 +75,12 @@ class Import extends Model {
75 75
76 $is_utf = (preg_match('//u', file_get_contents(Yii::getAlias('@uploadDir') .'/'. Yii::getAlias('@uploadFilePrices'), null, null, null, 1000000))); 76 $is_utf = (preg_match('//u', file_get_contents(Yii::getAlias('@uploadDir') .'/'. Yii::getAlias('@uploadFilePrices'), null, null, null, 1000000)));
77 77
  78 +
  79 +
  80 + Stock::updateAll(['stock' => 0 ]);
  81 + ProductVariant::updateAll(['status' => 0 ]);
  82 +
  83 +
78 while (empty($limit) || $j++ < $limit) 84 while (empty($limit) || $j++ < $limit)
79 { 85 {
80 86
common/modules/product/models/Stock.php
@@ -50,7 +50,7 @@ class Stock extends \yii\db\ActiveRecord @@ -50,7 +50,7 @@ class Stock extends \yii\db\ActiveRecord
50 return "МАГАЗИН ГЛУБОЧЕЦКАЯ"; 50 return "МАГАЗИН ГЛУБОЧЕЦКАЯ";
51 break; 51 break;
52 default: 52 default:
53 - return "На складе"; 53 + //return "На складе";
54 break; 54 break;
55 } 55 }
56 } 56 }
frontend/views/catalog/_product_item.php
@@ -69,7 +69,7 @@ use yii\helpers\Url; @@ -69,7 +69,7 @@ use yii\helpers\Url;
69 <div class="info"> 69 <div class="info">
70 <ul class="sv"> 70 <ul class="sv">
71 71
72 - <li><span>Бренд:</span> <?= $model->brand->name ?></li> 72 + <li><span>Бренд:</span> <?= !empty($model->brand) ? $model->brand->name : '' ?></li>
73 73
74 <?php foreach($model->getActiveProperties($category->category_id) as $group): ?> 74 <?php foreach($model->getActiveProperties($category->category_id) as $group): ?>
75 <li><span><?= $group->name ?> <?php foreach($group->_options as $option) : ?>&nbsp;</span><?= $option->ValueRenderHTML ?><?php endforeach ?></li> 75 <li><span><?= $group->name ?> <?php foreach($group->_options as $option) : ?>&nbsp;</span><?= $option->ValueRenderHTML ?><?php endforeach ?></li>
frontend/views/catalog/product.php
@@ -194,7 +194,7 @@ FlipclockAsset::register($this); @@ -194,7 +194,7 @@ FlipclockAsset::register($this);
194 <?php if($product->variant->stock > 0){?> 194 <?php if($product->variant->stock > 0){?>
195 есть в наличии 195 есть в наличии
196 <?php } else {?> 196 <?php } else {?>
197 - нет в наличии 197 + под заказ
198 <?php }?> 198 <?php }?>
199 </td> 199 </td>
200 <td rowspan="2" class="spacer">&nbsp;</td> 200 <td rowspan="2" class="spacer">&nbsp;</td>
@@ -308,7 +308,7 @@ FlipclockAsset::register($this); @@ -308,7 +308,7 @@ FlipclockAsset::register($this);
308 <?php if($product->variant->stock > 0){?> 308 <?php if($product->variant->stock > 0){?>
309 <a href="#" class="btn btn-large buy_button" data-toggle="modal" data-id="<?php echo $product->variant->product_variant_id; ?>" data-target="#buyForm" lang="5892">Купить</a> 309 <a href="#" class="btn btn-large buy_button" data-toggle="modal" data-id="<?php echo $product->variant->product_variant_id; ?>" data-target="#buyForm" lang="5892">Купить</a>
310 <?php } else {?> 310 <?php } else {?>
311 - <a href="#" style="background-color:dimgrey; background-image:linear-gradient(to bottom, #9d9fa0, #abafb2)" class="btn btn-large btn-default " data-id="<?php echo $product->variant->product_variant_id; ?>" >Нет в наличии</a> 311 + <a href="#" style="background-color:dimgrey; background-image:linear-gradient(to bottom, #9d9fa0, #abafb2)" class="btn btn-large btn-default " data-id="<?php echo $product->variant->product_variant_id; ?>" >Под заказ</a>
312 <?php }?> 312 <?php }?>
313 313
314 314
@@ -325,9 +325,12 @@ FlipclockAsset::register($this); @@ -325,9 +325,12 @@ FlipclockAsset::register($this);
325 </div> 325 </div>
326 <div class="clearfix"></div> 326 <div class="clearfix"></div>
327 </div> 327 </div>
328 - <div class="follow_price">  
329 - <a href="#" data-toggle="modal" data-target="#where_buy">где купить?</a>  
330 - </div> 328 + <?php if($product->variant->stock > 0){?>
  329 + <div class="follow_price">
  330 + <a href="#" data-toggle="modal" data-target="#where_buy">где купить?</a>
  331 + </div>
  332 + <?php } ?>
  333 +
331 334
332 <div class="follow_price"> 335 <div class="follow_price">
333 <?php 336 <?php
frontend/views/event/_product_item.php
@@ -70,7 +70,7 @@ $category = $model-&gt;category; @@ -70,7 +70,7 @@ $category = $model-&gt;category;
70 <div class="info"> 70 <div class="info">
71 <ul class="sv"> 71 <ul class="sv">
72 72
73 - <li><span>Бренд:</span> <?= $model->brand->name ?></li> 73 + <li><span>Бренд:</span> <?= !empty($model->brand) ? $model->brand->name : '' ?></li>
74 74
75 <?php foreach($model->getActiveProperties($category->category_id) as $group): ?> 75 <?php foreach($model->getActiveProperties($category->category_id) as $group): ?>
76 <li><span><?= $group->name ?> <?php foreach($group->_options as $option) : ?>&nbsp;</span><?= $option->ValueRenderHTML ?><?php endforeach ?></li> 76 <li><span><?= $group->name ?> <?php foreach($group->_options as $option) : ?>&nbsp;</span><?= $option->ValueRenderHTML ?><?php endforeach ?></li>