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 75  
76 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 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 50 return "МАГАЗИН ГЛУБОЧЕЦКАЯ";
51 51 break;
52 52 default:
53   - return "На складе";
  53 + //return "На складе";
54 54 break;
55 55 }
56 56 }
... ...
frontend/views/catalog/_product_item.php
... ... @@ -69,7 +69,7 @@ use yii\helpers\Url;
69 69 <div class="info">
70 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 74 <?php foreach($model->getActiveProperties($category->category_id) as $group): ?>
75 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 194 <?php if($product->variant->stock > 0){?>
195 195 есть в наличии
196 196 <?php } else {?>
197   - нет в наличии
  197 + под заказ
198 198 <?php }?>
199 199 </td>
200 200 <td rowspan="2" class="spacer">&nbsp;</td>
... ... @@ -308,7 +308,7 @@ FlipclockAsset::register($this);
308 308 <?php if($product->variant->stock > 0){?>
309 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 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 312 <?php }?>
313 313  
314 314  
... ... @@ -325,9 +325,12 @@ FlipclockAsset::register($this);
325 325 </div>
326 326 <div class="clearfix"></div>
327 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 335 <div class="follow_price">
333 336 <?php
... ...
frontend/views/event/_product_item.php
... ... @@ -70,7 +70,7 @@ $category = $model-&gt;category;
70 70 <div class="info">
71 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 75 <?php foreach($model->getActiveProperties($category->category_id) as $group): ?>
76 76 <li><span><?= $group->name ?> <?php foreach($group->_options as $option) : ?>&nbsp;</span><?= $option->ValueRenderHTML ?><?php endforeach ?></li>
... ...