From 9e6e908634285565b4e260ad8f398ce0b080b56f Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Mon, 16 Jan 2017 16:16:24 +0200 Subject: [PATCH] add similar products --- controllers/OrderController.php | 3 +++ 1 file changed, 3 insertions(+), 0 deletions(-) diff --git a/controllers/OrderController.php b/controllers/OrderController.php index 63c83f1..d068926 100755 --- a/controllers/OrderController.php +++ b/controllers/OrderController.php @@ -176,6 +176,7 @@ if (!empty( $model )) { $model->count += $count; + $model->removed = false; } else { $model = new OrderProduct(); @@ -186,6 +187,7 @@ $model->sku = $productVariant->sku; $model->price = $productVariant->price; $model->count = $count; + $model->removed = false; } \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; @@ -437,6 +439,7 @@ { $model = OrderProduct::findOne($id); $model->removed = true; + $model->count = 0; $model->save(); $order = Order::findOne($order_id); $order->totalRecount(); -- libgit2 0.21.4