problem with Cart Library, Cart Class |
[eluser]sihijau[/eluser]
i think therese bugs in the cart class, because i try using this library when i insert new item or update cart, the item in shoppingcart is reset to 1 item. my problem exactly same tothis problem my controller code: Code: <?php could anyone help me fix this? :down:
[eluser]skunkbad[/eluser]
This isn't a bug. Your code should check for the item in the cart before trying to add it twice. If the item is already in the cart, you should do an update, not an add. So, when your controller is getting post values and determining what to do with them, that is where you would provide logic to add vs. update. This method hasn't been added to Community Cart yet, but this is something I came up with: Code: public function add()
[eluser]sihijau[/eluser]
Owwhh my add method was too simple, there's not mechanism to check that an item already in cart, thanks for pointing me that.. |
Welcome Guest, Not a member yet? Register Sign In |