'show']; foreach ($query_params as $key => $value) { if (!in_array($key, $exclude_keys) && Validate::isUrl($key) && Validate::isUrl($value)) { $persist_keys[Tools::safeOutput($key)] = Tools::safeOutput($value); } } if ( $cart_id && $token && $token === KlaviyoUtils::buildRecoverCartToken($cart_id) ) { // This is intentionally not checked against the user's session to // allow for cross-device compatibility when recovering a cart. $reclaimed_cart = new Cart($cart_id); $customer_cart = new Customer((int)$reclaimed_cart->id_customer); // If the cart is associated to a customer // We can use PrestaShop's native cart recovery system // Otherwise we cant't. In this case, we have to implement it ourselves // See : FrontController::recoverCart if (Validate::isLoadedObject($customer_cart)) { $persist_keys['recover_cart'] = $reclaimed_cart->id; $persist_keys['token_cart'] = $token; } else { $this->context->cookie->id_cart = $reclaimed_cart->id; } } $link = $this->context->link; if ($link === null) { $link = new Link(); } $redirectLink = $link->getPageLink( 'cart', null, null, $persist_keys ); Tools::redirect($redirectLink); } } class KlaviyoPsAutomationReclaimModuleFrontController extends KlaviyoPsReclaimModuleFrontController { }