Skip to content

Commit b61fce5

Browse files
committed
ACP2E-368: Issue when adding multiple items in addProductsToCart graphQL mutation
1 parent cce336a commit b61fce5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ private function addItemToCart(CartInterface $cart, Data\CartItem $cartItem, int
177177
}
178178

179179
if (is_string($result)) {
180-
$errors = array_unique(explode("\n", $result));
181-
foreach ($errors as $error) {
180+
foreach (array_unique(explode("\n", $result)) as $error) {
182181
$errors[] = $this->createError(__($error)->render(), $cartItemPosition);
183182
}
184183
}

0 commit comments

Comments
 (0)