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