From 10b20e5a5cc07f398084eb58fa4385a6fc6cd226 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 27 Feb 2017 15:42:19 +0200 Subject: [PATCH] -Import prices fixed --- backend/views/site/index.php | 2 ++ common/modules/product/models/Import.php | 18 +++++------------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/backend/views/site/index.php b/backend/views/site/index.php index e69de29..8627121 100755 --- a/backend/views/site/index.php +++ b/backend/views/site/index.php @@ -0,0 +1,2 @@ +where(['product_variant_id' => $productVariant->product_variant_id])->all(); - - if($productStocks instanceof ProductStock){ - $quantity = array_sum(ArrayHelper::getColumn($productStocks, 'quantity')) + $count; + if ($count == 0) { + continue; } else { - $quantity = 0; - $productStocks = new ProductStock(); - $productStocks->product_id = $productVariant->product_id; - $productStocks->quantity = $quantity; - $productStocks->product_variant_id = $productVariant->product_variant_id; - $productStocks->save(); - + $productStocks = ProductStock::find()->where(['product_variant_id' => $productVariant->product_variant_id])->all(); + + $quantity = array_sum(ArrayHelper::getColumn($productStocks, 'quantity')) + $count; } - } if ($price_promo) { -- libgit2 0.21.4