Commit 8e9033a5fd009429842eb068a8164e0849292074

Authored by Administrator
1 parent 902cdc38

big commti

frontend/controllers/CatalogController.php
... ... @@ -152,9 +152,6 @@ class CatalogController extends \yii\web\Controller
152 152 /** @var Product $product */
153 153 $product = Yii::$app->request->get('product');
154 154  
155   - if(!$product->enabledVariant) {
156   - throw new HttpException(404, 'Товар не найден');
157   - }
158 155  
159 156 ProductHelper::addLastProsucts($product->product_id);
160 157  
... ...
frontend/views/catalog/product.php
... ... @@ -191,7 +191,11 @@ FlipclockAsset::register($this);
191 191 </tr>
192 192 <tr>
193 193 <td class="left_count available">
194   - под заказ
  194 + <?php if($product->variant->stock > 0){?>
  195 + есть в наличии
  196 + <?php } else {?>
  197 + нет в наличии
  198 + <?php }?>
195 199 </td>
196 200 <td rowspan="2" class="spacer">&nbsp;</td>
197 201 <td class="right_block" rowspan="2">
... ... @@ -301,7 +305,12 @@ FlipclockAsset::register($this);
301 305 </div>
302 306  
303 307 <div class="buy_button">
304   - <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>
  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>
  310 + <?php } else {?>
  311 + <a href="#" class="btn btn-large btn-default buy_button" data-id="<?php echo $product->variant->product_variant_id; ?>" >Нет в наличии</a>
  312 + <?php }?>
  313 +
305 314  
306 315  
307 316 <div class="clearfix"></div>
... ...