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 | 106 | |
107 | 107 | if ($from == 0) { |
108 | 108 | ProductStock::updateAll([ 'quantity' => 0 ]); |
109 | - ProductVariant::updateAll([ 'status' => 1 ]); | |
109 | + ProductVariant::updateAll([ 'status' => 1 ], 'status != 2'); | |
110 | 110 | } |
111 | 111 | |
112 | 112 | while (empty( $limit ) || $j++ < $limit) { |
... | ... | @@ -164,7 +164,9 @@ |
164 | 164 | // ===== Set stock ==== |
165 | 165 | if (!$city_name) { |
166 | 166 | if (!$count) { |
167 | - $productVariant->status = 0; | |
167 | + if ($productVariant->status !== 2) { | |
168 | + $productVariant->status = 0; | |
169 | + } | |
168 | 170 | if ($price_promo) { |
169 | 171 | $productVariant->price_old = $price; |
170 | 172 | $productVariant->price = $price_promo; |
... | ... | @@ -227,7 +229,9 @@ |
227 | 229 | } |
228 | 230 | |
229 | 231 | $productVariant->stock = $quantity; |
230 | - $productVariant->status = 0; | |
232 | + if ($productVariant->status !== 2) { | |
233 | + $productVariant->status = 0; | |
234 | + } | |
231 | 235 | $productVariant->save(); |
232 | 236 | |
233 | 237 | $this->output[] = '<font style="color:blue">Товар ' . $product_title . ' успешно сохранен</font>'; | ... | ... |