Skip to content

Commit

Permalink
add conditional cart general purpose assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieu-rolland committed Jul 30, 2024
1 parent 240caed commit 4f809d5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions classes/controller/FrontController.php
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,14 @@ protected function assignGeneralPurposeVariables()
'debug' => _PS_MODE_DEV_,
];

$dateFromFO = strtotime($_COOKIE['cart_last_update'] ?? false);
$dateFromDB = strtotime($cart->date_upd ?? false);

if ($dateFromFO < $dateFromDB) {
$templateVars['cart_last_update'] = $cart->date_upd;
$templateVars['cart'] = $this->cart_presenter->present($cart);
}

// An array [module_name => module_output] will be returned
$modulesVariables = Hook::exec(
'actionFrontControllerSetVariables',
Expand Down

0 comments on commit 4f809d5

Please sign in to comment.