summaryrefslogtreecommitdiffstats
path: root/system/libraries/Cart.php
diff options
context:
space:
mode:
authorAndrew Seymour <commit@andrewseymour.co.uk>2011-12-14 10:36:39 +0100
committerAndrew Seymour <commit@andrewseymour.co.uk>2011-12-14 10:36:39 +0100
commitf75ec11d7ed0592f930dd3a090db7c1c6d251eed (patch)
treefbff3328ac7e049bc6ac07c09a8b4bb59b3d3266 /system/libraries/Cart.php
parent17aebce8e06fae0edf1d54cf6823f1b8f48924c0 (diff)
Added in a remove item from cart function to save the "hacky" method of updating a product with 0 quantity, updated the changelog to reflect and to be neater and more readable surrounding the changes of the Cart library
Diffstat (limited to 'system/libraries/Cart.php')
-rw-r--r--system/libraries/Cart.php24
1 files changed, 23 insertions, 1 deletions
diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php
index e78ecd5f6..7f6cdf5dd 100644
--- a/system/libraries/Cart.php
+++ b/system/libraries/Cart.php
@@ -450,7 +450,29 @@ class CI_Cart {
{
return $this->_cart_contents['cart_total'];
}
-
+
+ // --------------------------------------------------------------------
+
+ /**
+ * Remove Item
+ *
+ * Removes an item from the cart
+ *
+ * @access public
+ * @return boolean
+ */
+ public function remove($rowid)
+ {
+ // just do an unset
+ unset($this->_cart_contents[$rowid]);
+
+ // we need to save the cart now we've made our changes
+ $this->_save_cart();
+
+ // completed
+ return true;
+ }
+
// --------------------------------------------------------------------
/**