From 9c35432fd2e130bb6c25002ec3d8ba82f8727235 Mon Sep 17 00:00:00 2001 From: Rakhal Imming Date: Thu, 19 May 2016 14:06:07 +0200 Subject: [PATCH] [Fix] Session quantity fix Row exists in session, sum up the session quantity and the new quantity given to the add method. --- src/Cart.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Cart.php b/src/Cart.php index 0d24dde..82960a8 100644 --- a/src/Cart.php +++ b/src/Cart.php @@ -99,7 +99,7 @@ class Cart $content = $this->getContent(); if ($content->has($cartItem->rowId)) { - $cartItem->qty++; + $cartItem->qty += $content->get($cartItem->rowId)->qty; } $content->put($cartItem->rowId, $cartItem); @@ -500,4 +500,4 @@ class Cart { return config('cart.database.table', 'shoppingcart'); } -} \ No newline at end of file +}