From d0c9e8f59bb223558195179e039a8b4f1f41a607 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Tue, 23 Jan 2018 15:56:33 +0100 Subject: [PATCH] Timestamp set at 10 minutes --- modules/ganalytics/header.tpl | 2 ++ override/controllers/OrderConfirmationController.php | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/ganalytics/header.tpl b/modules/ganalytics/header.tpl index 9aa5e654..5aae681f 100755 --- a/modules/ganalytics/header.tpl +++ b/modules/ganalytics/header.tpl @@ -38,6 +38,7 @@ }); {/foreach} + {/literal}{if $analytics_timeover == 0}{literal} ga('ec:setAction', 'purchase', { // Transaction details are provided in an actionFieldObject. 'id': '{$trans.id}', // (Required) Transaction id (string). 'affiliation': '{$trans.store}', // Affiliation (string). @@ -45,6 +46,7 @@ 'tax': '{$trans.tax}', // Tax (currency). 'shipping': '{$trans.shipping}', // Shipping (currency). }); + {/literal}{/if}{literal} {literal} var re = new RegExp("([?&])(email=)[^&#]*", "g"); diff --git a/override/controllers/OrderConfirmationController.php b/override/controllers/OrderConfirmationController.php index c8f4a61d..09677aed 100755 --- a/override/controllers/OrderConfirmationController.php +++ b/override/controllers/OrderConfirmationController.php @@ -43,10 +43,12 @@ class OrderConfirmationController extends OrderConfirmationControllerCore $products = SaleDelay::associateDelay($products); } - // check date order if page is refresh and not affect analytics + // Set cookie + + // Check date order if page is refresh and not affect analytics $timestamp_check = new DateTime(); $timestamp_check->createFromFormat('Y-m-d H:i:s', $order->date_add); - $timestamp_check->add(new DateInterval('PT1H')); + $timestamp_check->add(new DateInterval('PT10M')); $timestamp = $timestamp_check->getTimestamp(); $analytics_timeover = 0; if (time() > $timestamp) {