Skip to content

Commit 85fd270

Browse files
committed
Fixing the case when an error message appears twice
1 parent 52fb7a7 commit 85fd270

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class AddProductsToCart
3939
'Could not find a product with SKU' => self::ERROR_PRODUCT_NOT_FOUND,
4040
'The required options you selected are not available' => self::ERROR_NOT_SALABLE,
4141
'Product that you are trying to add is not available.' => self::ERROR_NOT_SALABLE,
42-
'This product is out of stock' => self::ERROR_NOT_SALABLE,
42+
'This product is out of stock' => self::ERROR_INSUFFICIENT_STOCK,
4343
'There are no source items' => self::ERROR_NOT_SALABLE,
4444
'The fewest you may purchase is' => self::ERROR_INSUFFICIENT_STOCK,
4545
'The most you may purchase is' => self::ERROR_INSUFFICIENT_STOCK,
@@ -153,6 +153,8 @@ private function addItemToCart(CartInterface $cart, Data\CartItem $cartItem, int
153153
__($e->getMessage())->render(),
154154
$cartItemPosition
155155
);
156+
$cart->setHasError(false);
157+
156158
return;
157159
}
158160

app/code/Magento/QuoteGraphQl/etc/schema.graphqls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ type SetGuestEmailOnCartOutput {
320320
}
321321

322322
input EnteredOptionInput {
323-
id: String! @doc(description: "base64 encoded option ID")
323+
id: ID! @doc(description: "base64 encoded option ID")
324324
value: String!
325325
}
326326

0 commit comments

Comments
 (0)