From e72768244677db8b7ef57fe2ed6b13d6c260bbf8 Mon Sep 17 00:00:00 2001 From: Rob Gloudemans Date: Tue, 28 May 2013 22:02:11 +0200 Subject: [PATCH] Fixed bug with row qty that wasn't correctly updated --- src/Gloudemans/Shoppingcart/Cart.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Gloudemans/Shoppingcart/Cart.php b/src/Gloudemans/Shoppingcart/Cart.php index 6a3acb8..13e33cc 100644 --- a/src/Gloudemans/Shoppingcart/Cart.php +++ b/src/Gloudemans/Shoppingcart/Cart.php @@ -51,6 +51,7 @@ class Cart { /** * Update the quantity of one row of the cart + * * @param string $rowId The rowid of the item you want to update * @param integer $qty New quantity of the item * @return boolean @@ -177,6 +178,7 @@ class Cart { /** * Update the cart + * * @param Array $cart The new cart content * @return void */ @@ -210,8 +212,8 @@ class Cart { $row = $cart->get($rowId); - $row->qty = $qty; - $row->subtotal = $row->qty * $row->price; + $row->put('qty', $qty); + $row->put('subtotal', $row->qty * $row->price); $cart->put($rowId, $row);