darryldecode / laravelshoppingcart

Shopping Cart Implementation for Laravel Framework
1.34k stars 443 forks source link

Cart does not return items in 5.2.* #51

Open obonyojimmy opened 8 years ago

obonyojimmy commented 8 years ago

I have installed package successfully ,

Cart::add(455, 'Sample Item', 100.99, 2, array());

Works , but get empty response when trying to retrieve the cart :

return Cart::getContent() ;
darryldecode commented 8 years ago

hello @obonyojimmy , did you try to dump like so:

Cart::add(455, 'Sample Item', 100.99, 2, array());

$items = Cart::getContent();

dd($items);

let me know what you get. Thanks!

mehran8023 commented 8 years ago

when i refresh web page after adding items in cart there is no items in cart.how i solve this problem? in cart session is not creating

azrahn commented 8 years ago

Laravel 5.2 needs the web middleware enabled! https://laravel.com/docs/5.2/middleware#middleware-groups