From f3f8709d60ff2edafb6ef189aeae50829a0b3346 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 21 Oct 2016 10:58:37 +0300 Subject: [PATCH] big commti --- common/modules/product/models/Import.php | 6 ++++++ common/modules/product/models/Stock.php | 2 +- frontend/views/catalog/_product_item.php | 2 +- frontend/views/catalog/product.php | 13 ++++++++----- frontend/views/event/_product_item.php | 2 +- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/common/modules/product/models/Import.php b/common/modules/product/models/Import.php index 791a83f..54b95d2 100755 --- a/common/modules/product/models/Import.php +++ b/common/modules/product/models/Import.php @@ -75,6 +75,12 @@ class Import extends Model { $is_utf = (preg_match('//u', file_get_contents(Yii::getAlias('@uploadDir') .'/'. Yii::getAlias('@uploadFilePrices'), null, null, null, 1000000))); + + + Stock::updateAll(['stock' => 0 ]); + ProductVariant::updateAll(['status' => 0 ]); + + while (empty($limit) || $j++ < $limit) { diff --git a/common/modules/product/models/Stock.php b/common/modules/product/models/Stock.php index 4fa53c3..b66c505 100755 --- a/common/modules/product/models/Stock.php +++ b/common/modules/product/models/Stock.php @@ -50,7 +50,7 @@ class Stock extends \yii\db\ActiveRecord return "МАГАЗИН ГЛУБОЧЕЦКАЯ"; break; default: - return "На складе"; + //return "На складе"; break; } } diff --git a/frontend/views/catalog/_product_item.php b/frontend/views/catalog/_product_item.php index 47db205..f8036da 100755 --- a/frontend/views/catalog/_product_item.php +++ b/frontend/views/catalog/_product_item.php @@ -69,7 +69,7 @@ use yii\helpers\Url;
-
- где купить? -
+ variant->stock > 0){?> +
+ где купить? +
+ +
category;
    -
  • Бренд: brand->name ?>
  • +
  • Бренд: brand) ? $model->brand->name : '' ?>
  • getActiveProperties($category->category_id) as $group): ?>
  • name ?> _options as $option) : ?> ValueRenderHTML ?>
  • -- libgit2 0.21.4