![]() |
Delete specific row in the Cart - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Delete specific row in the Cart (/showthread.php?tid=47217) |
Delete specific row in the Cart - El Forum - 11-30-2011 [eluser]Unknown[/eluser] I try to delete a specific row in the cart using the cart library. which I noticed that it has no delete function. Some forums suggest that you can use update function Code: $this->cart->update() price perhaps to 0. But!, still for me it doesn't work. I explored the library and made few changes. I used Code: $this->cart->insert() Code: $this->cart->update() Example: Code: $data = array( these are the lines that need to be change in the library. Remove or comment the line: Code: $items['qty'] = trim(preg_replace('/(^[0]+)/i', '', $items['qty'])); Code: $items['price'] = trim(preg_replace('/(^[0]+)/i', '', $items['price'])); And instead of these line: Code: // let's unset this first, just to make sure our index contains only the data from this submission Change it to this : Code: // let's unset this first, just to make sure our index contains only the data from this submission |