Skip to content

Commit 093eb32

Browse files
committed
ACP2E-368: Issue when adding multiple items in addProductsToCart graphQL mutation
- Without test
1 parent 7996e89 commit 093eb32

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/code/Magento/Quote/Model/Cart/AddProductsToCart.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ public function execute(string $maskedCartId, array $cartItems): AddProductsToCa
103103
$cart = $this->cartRepository->get($cartId);
104104

105105
foreach ($cartItems as $cartItemPosition => $cartItem) {
106+
if ($cartItemPosition != 0 && empty($cart->getItems())) {
107+
$cart = $this->cartRepository->get($cartId);
108+
}
106109
$this->addItemToCart($cart, $cartItem, $cartItemPosition);
107110
}
108111

0 commit comments

Comments
 (0)