prevent multi tracking after registration

This commit is contained in:
Marion Muszynski 2017-07-26 13:21:18 +02:00
parent 3525fdc711
commit 58b3c509b4

View File

@ -302,6 +302,16 @@ class TrackingTag extends Module {
public function hookAccountValidation($params) {
global $cookie, $site_version_front;
if($cookie->isLogged()) {
$customer = new Customer((int)$cookie->id_customer);
$accountCreationDateTime = new DateTime($customer->date_add);
$nowDateTime = new DateTime();
$maxTrackingDateInterval = new DateInterval('PT8S'); //8 seconds
if ($nowDateTime > $accountCreationDateTime->add($maxTrackingDateInterval)) {
return '';
}
}
$tags = Db::getInstance()->ExecuteS('
SELECT *
FROM `'._DB_PREFIX_.'trackingtag`
@ -317,6 +327,9 @@ class TrackingTag extends Module {
$output = '';
foreach($tags as $tag) {
if((int)$tag['id_trackingtag'] == 2 && $cookie->id_lang == 3){
continue;
}
$output .= str_replace(array(
'{id_customer}',
'{email}',