Merge pull request #2958 from jitendra-webkul/1.0

Issue #2954 fixed
This commit is contained in:
Jitendra Singh 2020-04-28 20:03:36 +05:30 committed by GitHub
commit a8c969d019
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -54,6 +54,8 @@
* #2943 [fixed] - Scroll images is not working
* #2954 [fixed] - The merging cart function does not work when already added all items of product into customer cart
## **v1.1.0 (24th of March 2020)** - *Release*

View File

@ -368,8 +368,14 @@ class Cart
continue;
}
$found = true;
$cartItem->quantity = $newQuantity = $cartItem->quantity + $guestCartItem->quantity;
if ($cartItem->quantity > $cartItem->product->getTypeInstance()->totalQuantity()) {
$cartItem->quantity = $newQuantity = $cartItem->product->getTypeInstance()->totalQuantity();
}
if (! $this->isItemHaveQuantity($cartItem)) {
$this->cartItemRepository->delete($guestCartItem->id);
@ -387,8 +393,6 @@ class Cart
$guestCart->items->forget($key);
$this->cartItemRepository->delete($guestCartItem->id);
$found = true;
}
if (! $found) {