mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-23 23:51:25 +00:00
[Fix] Session quantity fix
Row exists in session, sum up the session quantity and the new quantity given to the add method.
This commit is contained in:
@@ -99,7 +99,7 @@ class Cart
|
|||||||
$content = $this->getContent();
|
$content = $this->getContent();
|
||||||
|
|
||||||
if ($content->has($cartItem->rowId)) {
|
if ($content->has($cartItem->rowId)) {
|
||||||
$cartItem->qty++;
|
$cartItem->qty += $content->get($cartItem->rowId)->qty;
|
||||||
}
|
}
|
||||||
|
|
||||||
$content->put($cartItem->rowId, $cartItem);
|
$content->put($cartItem->rowId, $cartItem);
|
||||||
@@ -500,4 +500,4 @@ class Cart
|
|||||||
{
|
{
|
||||||
return config('cart.database.table', 'shoppingcart');
|
return config('cart.database.table', 'shoppingcart');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user