summaryrefslogtreecommitdiffstats
path: root/system/libraries/Cart.php
diff options
context:
space:
mode:
authorAhmad Anbar <aanbar@gmail.com>2014-02-13 01:40:45 +0100
committerAhmad Anbar <aanbar@gmail.com>2014-02-13 01:40:45 +0100
commit11db7a7da940a6ab0168a70b71194f078cdf953d (patch)
treee4f51de6f46721146fa2cef477bb16cb5ffda33e /system/libraries/Cart.php
parent7d16de620a46f84ffeb52a54ae82439a06f89c74 (diff)
Delete by values, not keys
Diffstat (limited to 'system/libraries/Cart.php')
-rw-r--r--system/libraries/Cart.php7
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)
{