From cbcfc70ca3a6b999f977576d9b9c09b3b6df44d2 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 23 Jun 2017 11:16:15 +0300 Subject: [PATCH] -Import fixed for Trio --- common/modules/product/models/Import.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/common/modules/product/models/Import.php b/common/modules/product/models/Import.php index 20132a2..37c7171 100755 --- a/common/modules/product/models/Import.php +++ b/common/modules/product/models/Import.php @@ -106,7 +106,7 @@ if ($from == 0) { ProductStock::updateAll([ 'quantity' => 0 ]); - ProductVariant::updateAll([ 'status' => 1 ]); + ProductVariant::updateAll([ 'status' => 1 ], 'status != 2'); } while (empty( $limit ) || $j++ < $limit) { @@ -164,7 +164,9 @@ // ===== Set stock ==== if (!$city_name) { if (!$count) { - $productVariant->status = 0; + if ($productVariant->status !== 2) { + $productVariant->status = 0; + } if ($price_promo) { $productVariant->price_old = $price; $productVariant->price = $price_promo; @@ -227,7 +229,9 @@ } $productVariant->stock = $quantity; - $productVariant->status = 0; + if ($productVariant->status !== 2) { + $productVariant->status = 0; + } $productVariant->save(); $this->output[] = 'Товар ' . $product_title . ' успешно сохранен'; -- libgit2 0.21.4