From efaa1df4b96e381cfd3f6d98f2635e71c9354e93 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 5 Dec 2016 18:00:03 +0200 Subject: [PATCH] remarketing --- frontend/controllers/OrderController.php | 7 +------ frontend/views/order/success.php | 14 ++++++-------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/frontend/controllers/OrderController.php b/frontend/controllers/OrderController.php index a95e15c..a973a70 100755 --- a/frontend/controllers/OrderController.php +++ b/frontend/controllers/OrderController.php @@ -168,12 +168,7 @@ public function actionSuccess() { - $basket = \Yii::$app->basket; - $data = $basket->getData(); - $models = $basket->findModels(array_keys($data)); - return $this->render('success', [ - 'models' => $models - ]); + return $this->render('success'); } diff --git a/frontend/views/order/success.php b/frontend/views/order/success.php index 8e0f180..4f4bba3 100755 --- a/frontend/views/order/success.php +++ b/frontend/views/order/success.php @@ -1,11 +1,9 @@ session[ 'order_data' ]; \Yii::$app->session->remove('order_data'); @@ -15,15 +13,15 @@ $this->params['remarketing']['type'] = 'conversion'; $this->params['remarketing']['id'] = ''; $this->params['remarketing']['price'] = ''; - if (count($models) > 1) { - foreach ($models as $model) { - $this->params['remarketing']['id'][] = $model->product_id; - $this->params['remarketing']['price'][] = $model->price; + if (count($variants) > 1) { + foreach ($variants as $variant) { + $this->params['remarketing']['id'][] = $variant->product_id; + $this->params['remarketing']['price'][] = $variant->price; } } else { - $this->params['remarketing']['id'] = $models[0]->product_id; - $this->params['remarketing']['price'] = $models[0]->price; + $this->params['remarketing']['id'] = $variants[0]->product_id; + $this->params['remarketing']['price'] = $variants[0]->price; } -- libgit2 0.21.4