Commit 993186ae02f1fa8f4451a9de6407ca00434196aa
1 parent
4cf114ff
remarketing
Showing
2 changed files
with
20 additions
and
1 deletions
Show diff stats
frontend/views/layouts/main.php
@@ -553,7 +553,18 @@ | @@ -553,7 +553,18 @@ | ||
553 | ]) ?> | 553 | ]) ?> |
554 | </div> | 554 | </div> |
555 | <?php | 555 | <?php |
556 | - if (isset($this->params['remarketing'])) { | 556 | + if (isset($this->params['remarketing']) && is_array($this->params['remarketing']['id'])) { |
557 | + echo ' | ||
558 | + <script type="text/javascript"> | ||
559 | + var google_tag_params = { | ||
560 | + dynx_pagetype: "'.$this->params['remarketing']['type'].'", | ||
561 | + dynx_itemid: ["'.implode('", "', $this->params['remarketing']['id']).'"], | ||
562 | + dynx_totalvalue: ["'.implode('", "', $this->params['remarketing']['price']).'"] | ||
563 | + } | ||
564 | + </script> | ||
565 | + '; | ||
566 | + } | ||
567 | + elseif (isset($this->params['remarketing'])) { | ||
557 | echo ' | 568 | echo ' |
558 | <script type="text/javascript"> | 569 | <script type="text/javascript"> |
559 | var google_tag_params = { | 570 | var google_tag_params = { |
frontend/views/order/index.php
@@ -9,11 +9,19 @@ use yii\web\View; | @@ -9,11 +9,19 @@ use yii\web\View; | ||
9 | $this->title = "Корзина"; | 9 | $this->title = "Корзина"; |
10 | $this->params[ 'seo' ][ Seo::H1] = $this->title ; | 10 | $this->params[ 'seo' ][ Seo::H1] = $this->title ; |
11 | $this->params[ 'seo' ][ Seo::TITLE] = $this->title; | 11 | $this->params[ 'seo' ][ Seo::TITLE] = $this->title; |
12 | + | ||
12 | /** | 13 | /** |
13 | * @var View $this | 14 | * @var View $this |
14 | * @var ProductVariant[] $models | 15 | * @var ProductVariant[] $models |
15 | * @var Basket $basket | 16 | * @var Basket $basket |
16 | */ | 17 | */ |
18 | +$this->params['remarketing']['type'] = 'conversionintent'; | ||
19 | +$this->params['remarketing']['id'] = ''; | ||
20 | +$this->params['remarketing']['price'] = ''; | ||
21 | +foreach ($models as $model) { | ||
22 | + $this->params['remarketing']['id'][] = $model->product_id; | ||
23 | + $this->params['remarketing']['price'][] = $model->price; | ||
24 | +} | ||
17 | ?> | 25 | ?> |
18 | <?php if ($flash = Yii::$app->session->getFlash ('success')): ?> | 26 | <?php if ($flash = Yii::$app->session->getFlash ('success')): ?> |
19 | <div class="alert-success"><?= $flash ?></div> | 27 | <div class="alert-success"><?= $flash ?></div> |