Timestamp set at 10 minutes

This commit is contained in:
Michael RICOIS 2018-01-23 15:56:33 +01:00
parent 645d3bd0a1
commit d0c9e8f59b
2 changed files with 6 additions and 2 deletions

View File

@ -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");

View File

@ -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) {