Open nechukhaeva opened 3 years ago
$ cart_id is always the same.
Add \Illuminate\Session\Middleware\StartSession::class to global HTTP middleware stack in Kernel.php
Add \Illuminate\Session\Middleware\StartSession::class to global HTTP middleware stack in Kernel.php
Thank you! It helped to solve the issue for me! I think this info should be in the docks, not in the depths of "issues"...
These are my methods for working with the cart. But after I add the product and call the new method, the basket is empty.
public function index() { if(!isset($_COOKIE['cart_id'])) { $_COOKIE['cart_id'] = uniqid(); setcookie('cart_id', uniqid(), 0); } $cart_id = $_COOKIE["cart_id"]; $cart = \Cart::session($cart_id);