From f69f1822558645aa00944b436558fb6948f42aa9 Mon Sep 17 00:00:00 2001 From: Ahmad Anbar Date: Tue, 11 Feb 2014 22:55:47 +0200 Subject: Allow updating all properties for an item. --- system/libraries/Cart.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'system/libraries/Cart.php') diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php index 5a31a1d45..b00ccd862 100644 --- a/system/libraries/Cart.php +++ b/system/libraries/Cart.php @@ -350,7 +350,11 @@ class CI_Cart { } else { - $this->_cart_contents[$items['rowid']]['qty'] = $items['qty']; + // find updatable keys + $keys = array_intersect(array_keys($this->_cart_contents[$items['rowid']]), array_keys($items)); + foreach ( $keys as $key ) { + $this->_cart_contents[$items['rowid']][$key] = $items[$key]; + } } return TRUE; -- cgit v1.2.3-24-g4f1b