beaudenheijer Posted October 6, 2019 Share Posted October 6, 2019 (edited) In the newer version of prestashop i encountered a weird bug when you add the cart tot the back-end. the debug mode screenshot is below. and the code is below the screenshot. require 'config/config.inc.php'; require 'init.php'; session_start(); try { $id = isset($_SESSION['Cart_ID']) ? (int)$_SESSION['Cart_ID'] : null; $cart = new Cart($id, null); $cart->save(); // problem is just in this line $_SESSION['Cart_ID'] = $cart->id; if($_SERVER['REQUEST_METHOD'] === "POST") { if(isset($_POST['add_to_cart'], $_POST['id_product']) || !empty($_POST['id_product'])) { $cart->updateQty(1, $_POST['id_product']); $cart->update(); header("Location: index.php"); } } } catch (PrestaShopException $e) { echo $e; } Edited October 6, 2019 by beaudenheijer (see edit history) Link to comment Share on other sites More sharing options...
beaudenheijer Posted October 6, 2019 Author Share Posted October 6, 2019 (edited) Note: I will reply between 09:00 - 12:00 amsterdam time! edit ( forgot to mention ) : this will continue when i reinstall prestashop Edited October 6, 2019 by beaudenheijer (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now