From 76eb16036ba7ee157f23cd779ce994a3f954271c Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Fri, 9 Mar 2018 11:21:41 +0100 Subject: [PATCH] update date_upd to customer --- override/classes/FrontController.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/override/classes/FrontController.php b/override/classes/FrontController.php index 86761487..0c575e84 100755 --- a/override/classes/FrontController.php +++ b/override/classes/FrontController.php @@ -246,6 +246,17 @@ class FrontController extends FrontControllerCore // @Override Antadis - prevent double fb tracking on registration if customer already exists if ($cookie->isLogged()) { $customer = new Customer((int)$cookie->id_customer); + + // Update date_upd + $lastVisit = DateTime::createFromFormat('Y-m-d H:i:s', $customer->date_upd); + $compare = new DateTime(); + $compare->add(new DateInterval('P5D')); + + if ($compare > $lastVisit) { + $customer->date_upd = date('YmdHis'); + $customer->update(); + } + $accountCreationDateTime = new DateTime($customer->date_add); $nowDateTime = new DateTime(); $maxTrackingDateInterval = new DateInterval('PT5S'); //5 seconds