melihovv / laravel-shopping-cart

Laravel shopping cart package
MIT License
73 stars 29 forks source link

Adding item to cart then using Cart::count() on blade view does not work #16

Closed JamieCee20 closed 4 years ago

JamieCee20 commented 4 years ago

In my function I add an item to the cart, this works as it should and have done multiple checks to ensure the right data is also being passed in, then I redirect to a cart page and attempt to do Cart::count() > 0 to display information if the cart isnt empty except on the blade it returns the cart as empty?

melihovv commented 4 years ago

I think you should call Cart::restore() to load data from storage to memory before you call Cart::count().