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;