Update Cart item quantity |
[eluser]Ngulo[/eluser]
guys,i can't understand how can i update a qty value into $this->cart->contents() ? i'm using this code: Code: foreach($this->cart->contents() as $cart) really can't find how to update quantities keys in cart items ![]() var_dump($this->cart->contents()) says always: Code: array(7) { any suggestion guys? ![]() thanks ![]()
[eluser]pbreit[/eluser]
According to: http://ellislab.com/codeigniter/user-gui.../cart.html It would be something like this: Code: $data = array( You need to first determine the rowid of the item you want to adjust quantity.
[eluser]dysko[/eluser]
I have similar problem... ![]() I know that I can update Qty with: Code: $data = array( ![]() If I try something like this: Code: $data = array( ![]()
[eluser]StevenSokulski[/eluser]
[quote author="dysko" date="1332205778"]I have similar problem... ![]() I know that I can update Qty with: Code: $data = array( ![]() If I try something like this: Code: $data = array( ![]() I have the same question. It doesn't seem like anything beyond the quantity can be updated. ![]()
[eluser]StevenSokulski[/eluser]
Did some digging in the Cart library's source and found that, in fact, the qty is the only thing setup to be updated by the $this->cart->update() method. Doh! I think in the short term I'm going to modify the data using the Session class. Kinda kludgy, but I think it'll get me past this roadblock until I have time to extend the core functionality of Cart.
[eluser]dysko[/eluser]
I've solved my problem by rewriting that class... Now I can update anything ![]()
[eluser]StevenSokulski[/eluser]
Any chance you'd be willing to share your modifications? I used the Session class to get around the limitations this time, but would love to have more flexibility in the future. |
Welcome Guest, Not a member yet? Register Sign In |