Commit cbcfc70ca3a6b999f977576d9b9c09b3b6df44d2
1 parent
b56756ad
-Import fixed for Trio
Showing
1 changed file
with
7 additions
and
3 deletions
Show diff stats
common/modules/product/models/Import.php
@@ -106,7 +106,7 @@ | @@ -106,7 +106,7 @@ | ||
106 | 106 | ||
107 | if ($from == 0) { | 107 | if ($from == 0) { |
108 | ProductStock::updateAll([ 'quantity' => 0 ]); | 108 | ProductStock::updateAll([ 'quantity' => 0 ]); |
109 | - ProductVariant::updateAll([ 'status' => 1 ]); | 109 | + ProductVariant::updateAll([ 'status' => 1 ], 'status != 2'); |
110 | } | 110 | } |
111 | 111 | ||
112 | while (empty( $limit ) || $j++ < $limit) { | 112 | while (empty( $limit ) || $j++ < $limit) { |
@@ -164,7 +164,9 @@ | @@ -164,7 +164,9 @@ | ||
164 | // ===== Set stock ==== | 164 | // ===== Set stock ==== |
165 | if (!$city_name) { | 165 | if (!$city_name) { |
166 | if (!$count) { | 166 | if (!$count) { |
167 | - $productVariant->status = 0; | 167 | + if ($productVariant->status !== 2) { |
168 | + $productVariant->status = 0; | ||
169 | + } | ||
168 | if ($price_promo) { | 170 | if ($price_promo) { |
169 | $productVariant->price_old = $price; | 171 | $productVariant->price_old = $price; |
170 | $productVariant->price = $price_promo; | 172 | $productVariant->price = $price_promo; |
@@ -227,7 +229,9 @@ | @@ -227,7 +229,9 @@ | ||
227 | } | 229 | } |
228 | 230 | ||
229 | $productVariant->stock = $quantity; | 231 | $productVariant->stock = $quantity; |
230 | - $productVariant->status = 0; | 232 | + if ($productVariant->status !== 2) { |
233 | + $productVariant->status = 0; | ||
234 | + } | ||
231 | $productVariant->save(); | 235 | $productVariant->save(); |
232 | 236 | ||
233 | $this->output[] = '<font style="color:blue">Товар ' . $product_title . ' успешно сохранен</font>'; | 237 | $this->output[] = '<font style="color:blue">Товар ' . $product_title . ' успешно сохранен</font>'; |