Commit 468bbe6e2aa152379292420b2f80e460260cf8d8
1 parent
91336280
remarketing
Showing
2 changed files
with
14 additions
and
16 deletions
Show diff stats
frontend/views/order/index.php
| @@ -16,15 +16,13 @@ $this->params[ 'seo' ][ Seo::TITLE] = $this->title; | @@ -16,15 +16,13 @@ $this->params[ 'seo' ][ Seo::TITLE] = $this->title; | ||
| 16 | * @var Basket $basket | 16 | * @var Basket $basket |
| 17 | */ | 17 | */ |
| 18 | $this->params['remarketing']['type'] = 'conversion'; | 18 | $this->params['remarketing']['type'] = 'conversion'; |
| 19 | -$this->params['remarketing']['id'] = ''; | ||
| 20 | -$this->params['remarketing']['price'] = ''; | ||
| 21 | if (count($models) > 1) { | 19 | if (count($models) > 1) { |
| 22 | foreach ($models as $model) { | 20 | foreach ($models as $model) { |
| 23 | - $this->params['remarketing']['id'][] = $model->product_id; | 21 | + $this->params['remarketing']['id'][] = $model->product_variant_id; |
| 24 | $this->params['remarketing']['price'][] = $model->price; | 22 | $this->params['remarketing']['price'][] = $model->price; |
| 25 | } | 23 | } |
| 26 | } elseif(!empty($models)) { | 24 | } elseif(!empty($models)) { |
| 27 | - $this->params['remarketing']['id'] = $models[0]->product_id; | 25 | + $this->params['remarketing']['id'] = $models[0]->product_variant_id; |
| 28 | $this->params['remarketing']['price'] = $models[0]->price; | 26 | $this->params['remarketing']['price'] = $models[0]->price; |
| 29 | } else { | 27 | } else { |
| 30 | $this->params['remarketing']['id'] = ''; | 28 | $this->params['remarketing']['id'] = ''; |
frontend/views/order/success.php
| @@ -11,18 +11,18 @@ | @@ -11,18 +11,18 @@ | ||
| 11 | $variants = $order_data[ 'variants' ]; | 11 | $variants = $order_data[ 'variants' ]; |
| 12 | 12 | ||
| 13 | $this->params['remarketing']['type'] = 'conversion'; | 13 | $this->params['remarketing']['type'] = 'conversion'; |
| 14 | - $this->params['remarketing']['id'] = ''; | ||
| 15 | - $this->params['remarketing']['price'] = ''; | ||
| 16 | -// if (count($variants) > 1) { | ||
| 17 | -// foreach ($variants as $variant) { | ||
| 18 | -// $this->params['remarketing']['id'][] = $variant['product_id']; | ||
| 19 | -// $this->params['remarketing']['price'][] = $variant['price']; | ||
| 20 | -// } | ||
| 21 | -// } | ||
| 22 | -// else { | ||
| 23 | -// $this->params['remarketing']['id'] = $variants[0]['product_id']; | ||
| 24 | -// $this->params['remarketing']['price'] = $variants[0]['price']; | ||
| 25 | -// } | 14 | + if (count($variants) > 1) { |
| 15 | + foreach ($variants as $variant) { | ||
| 16 | + $this->params['remarketing']['id'][] = $variant['mod_id']; | ||
| 17 | + $this->params['remarketing']['price'][] = $variant['price']; | ||
| 18 | + } | ||
| 19 | + } elseif(!empty($variants)) { | ||
| 20 | + $this->params['remarketing']['id'] = $variants[0]['mod_id']; | ||
| 21 | + $this->params['remarketing']['price'] = $variants[0]['price']; | ||
| 22 | + } else { | ||
| 23 | + $this->params['remarketing']['id'] = ''; | ||
| 24 | + $this->params['remarketing']['price'] = ''; | ||
| 25 | + } | ||
| 26 | 26 | ||
| 27 | ?> | 27 | ?> |
| 28 | <!--<div><?= var_dump($variants); ?></div>--> | 28 | <!--<div><?= var_dump($variants); ?></div>--> |