Merge remote-tracking branch 'origin/tickets/customer_date_upd'

This commit is contained in:
Michael RICOIS 2018-03-12 10:05:44 +01:00
commit 9115434424

View File

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