Add cookie reset if id_transaction is different

This commit is contained in:
Michael RICOIS 2018-01-23 17:36:17 +01:00
parent 85f4874ac8
commit 588898123a

View File

@ -48,6 +48,14 @@ class OrderConfirmationController extends OrderConfirmationControllerCore
// Cookie
global $cookie;
// Reset
if (isset($cookie->id_transaction)) {
if ($cookie->id_transaction != $order->id) {
unset($cookie->id_transaction);
unset($cookie->transCpt);
}
}
// Set counter
if (isset($cookie->transCpt)) {
$transCpt = (int) $cookie->transCpt;
}
@ -71,6 +79,7 @@ class OrderConfirmationController extends OrderConfirmationControllerCore
// Write cookie
$cookie->transCpt = $transCpt;
$cookie->id_transaction = $order->id;
$cookie->write();
self::$smarty->assign(