diff --git a/frontend/controllers/OrderController.php b/frontend/controllers/OrderController.php index a973a70..a95e15c 100755 --- a/frontend/controllers/OrderController.php +++ b/frontend/controllers/OrderController.php @@ -168,7 +168,12 @@ public function actionSuccess() { - return $this->render('success'); + $basket = \Yii::$app->basket; + $data = $basket->getData(); + $models = $basket->findModels(array_keys($data)); + return $this->render('success', [ + 'models' => $models + ]); } diff --git a/frontend/views/order/success.php b/frontend/views/order/success.php index 1d5ce49..d75d184 100755 --- a/frontend/views/order/success.php +++ b/frontend/views/order/success.php @@ -10,19 +10,18 @@ $order = $order_data[ 'order' ]; $variants = $order_data[ 'variants' ]; - $products = $order->getBasketMods(); $this->params['remarketing']['type'] = 'conversion'; $this->params['remarketing']['id'] = ''; $this->params['remarketing']['price'] = ''; - if (count($products) > 1) { - foreach ($products as $product) { - $this->params['remarketing']['id'][] = $product->product_id; - $this->params['remarketing']['price'][] = $product->price; + if (count($models) > 1) { + foreach ($models as $model) { + $this->params['remarketing']['id'][] = $model->product_id; + $this->params['remarketing']['price'][] = $model->price; } } else { - $this->params['remarketing']['id'] = $products[0]->product_id; - $this->params['remarketing']['price'] = $products[0]->price; + $this->params['remarketing']['id'] = $models[0]->product_id; + $this->params['remarketing']['price'] = $models[0]->price; } -- libgit2 0.21.4