diff options
author | Ahmad Anbar <aanbar@gmail.com> | 2014-02-13 01:40:45 +0100 |
---|---|---|
committer | Ahmad Anbar <aanbar@gmail.com> | 2014-02-13 01:40:45 +0100 |
commit | 11db7a7da940a6ab0168a70b71194f078cdf953d (patch) | |
tree | e4f51de6f46721146fa2cef477bb16cb5ffda33e /system | |
parent | 7d16de620a46f84ffeb52a54ae82439a06f89c74 (diff) |
Delete by values, not keys
Diffstat (limited to 'system')
-rw-r--r-- | system/libraries/Cart.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php index f5e85b715..8a2516f1c 100644 --- a/system/libraries/Cart.php +++ b/system/libraries/Cart.php @@ -353,14 +353,13 @@ class CI_Cart { // find updatable keys $keys = array_intersect(array_keys($this->_cart_contents[$items['rowid']]), array_keys($items)); // if a price was passed, make sure it contains valid data - if (isset($keys['price'])) + if (isset($items['price'])) { - $keys['price'] = (float) $keys['price']; + $items['price'] = (float) $items['price']; } // product name & id shouldn't be changed - unset($keys['name']); - unset($keys['id']); + $keys = array_diff($keys, array('id', 'name')); foreach ($keys as $key) { |