Commit 9e6e908634285565b4e260ad8f398ce0b080b56f
1 parent
52e22ec2
add similar products
Showing
1 changed file
with
3 additions
and
0 deletions
Show diff stats
controllers/OrderController.php
... | ... | @@ -176,6 +176,7 @@ |
176 | 176 | |
177 | 177 | if (!empty( $model )) { |
178 | 178 | $model->count += $count; |
179 | + $model->removed = false; | |
179 | 180 | } else { |
180 | 181 | $model = new OrderProduct(); |
181 | 182 | |
... | ... | @@ -186,6 +187,7 @@ |
186 | 187 | $model->sku = $productVariant->sku; |
187 | 188 | $model->price = $productVariant->price; |
188 | 189 | $model->count = $count; |
190 | + $model->removed = false; | |
189 | 191 | } |
190 | 192 | \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; |
191 | 193 | |
... | ... | @@ -437,6 +439,7 @@ |
437 | 439 | { |
438 | 440 | $model = OrderProduct::findOne($id); |
439 | 441 | $model->removed = true; |
442 | + $model->count = 0; | |
440 | 443 | $model->save(); |
441 | 444 | $order = Order::findOne($order_id); |
442 | 445 | $order->totalRecount(); | ... | ... |