vanilophp / cart

Cart Module for Vanilo (or any Laravel app)
https://vanilo.io
MIT License
50 stars 17 forks source link

How to Update cart item quantity #7

Closed victorighalo closed 5 years ago

victorighalo commented 5 years ago

So I've implemented using the cart library in my project but i can't seem to be able to update a cart item's quantity. How do I do that?

fulopattila122 commented 5 years ago

How do you add an item to your cart? How do you get the quantity from the cart?

victorighalo commented 5 years ago

How do you add an item to your cart? How do you get the quantity from the cart?

There are static methods addItem() and itemCount(). The method getItems() returns a collection. I was expecting it to return a Model instance so i can run a where query on it and get the cart item then modify and save..

victorighalo commented 5 years ago

I got it to work, i used your example here

https://github.com/vanilophp/demo/blob/0.5/app/Http/Controllers/CartController.php

Thanks.

fulopattila122 commented 5 years ago

Check this to clarify the details: https://vanilo.io/docs/0.5/cart