Skip to content

Commit

Permalink
Merge pull request #11 from tatiana-scandi/bugfix/1652/remove-items-f…
Browse files Browse the repository at this point in the history
…rom-wishlist

bugfix #1652
  • Loading branch information
lianastaskevica authored Mar 25, 2021
2 parents 9f9aa41 + c7d0e1b commit 66e345a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Model/Resolver/MoveWishlistToCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ protected function addItemsToCart(array $wishlistItems, CartInterface $quote): v

$quoteItem = $quote->addProduct($product, $buyRequest);
$quoteItem->setQty($item['qty']);

$item['item']->delete();
}

try {
Expand All @@ -126,6 +128,7 @@ protected function getWishlistItems(Wishlist $wishlist, bool $shouldDeleteItems)
$superAttribute = $item->getBuyRequest()->getSuperAttribute();

$items[$product->getSku()] = [
'item' => $item,
'qty' => $item->getQty(),
'product' => $product,
'super_attribute' => $superAttribute,
Expand Down Expand Up @@ -185,6 +188,8 @@ public function resolve(

$qty += $wishlistItem['qty'];
$item->setQty($qty);

$wishlistItem['item']->delete();
}
}

Expand Down

0 comments on commit 66e345a

Please sign in to comment.