Open avigato opened 6 years ago
I've managed to partially fix by disabling "encrypt cookie" and "http only" in session.php. There seems to be some problems with session and cache management but still can't understand why.
Now I can reach 3 items in cart, after the 3rd nothing is added to the session. Everything else is working good, I can get the total amount, total quantity and else but cannot add more than 3 items in the Cart.
@Murphz hello, dude. Did you fix it? Have the same problem.
@NurOleg can't remember the real fix. It was a problem with Laravel sessions anyway, after using database and fixing something in a file of the package, everything was ok.
Could be nice to know the fix, as this package is bugged, maybe you could do a pull request.
what was the solution??
I solved this by changing SESSION DRIVER from cookies to file in .env file
Hi, I'm using laravel 5.5 with darryldecode/cart 3.0.
addToCart function in Controller: ` if(Cart::session($userid)->get($itemid)){ Cart::session($userid)->update($itemid, array('quantity' => $quantity));
}else{ Cart::session($userid)->add(array( 'id' => $vino->articolo, 'name' => $vino->descrizione, 'price' => $vino->prezzo_vendita, 'quantity' => $quantity, //'attributes' => array(), )); }
`
I'm using the userID for the user and the item ID (SKU) as rowID. The first item added to the session is working good, if I try to update the quantity by the rowID is ok. But whatever I add after the first item is not being added to the session and not recognized anymore by the update code.
So I end with something like this:
{"SCR06":{"id":"SCR06","name":"Amarone Classico della Valpolicella DOCG Magnum","price":68.5,"quantity":10,"attributes":[],"conditions":[]},"CCE10":{"id":"CCE10","name":"Cabernet Sauvignon Palazzo del Principe","price":8.9,"quantity":1,"attributes":[],"conditions":[]},"total":693.9}
The first item added, SRC06, is being updated correctly...the second one is not really registered in the session and I'm not able to update it. If I refresh and try $cart = Cart::session($userid)->getContent(); without the add, the first item appears correctly, the second one no.
How can I manage multiple item in the same session cart?