Skip to content

Commit c94f061

Browse files
committed
MAGETWO-66162: [GitHub][PR] Fixes duplicate messages shown when adding items to cart #7615
- Merge Pull Request #7615 from comdiler/magento2:bugs/quote_item_duplicate_message
2 parents 3c34e1d + c5699b9 commit c94f061

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,10 +1625,11 @@ public function addProduct(
16251625

16261626
// collect errors instead of throwing first one
16271627
if ($item->getHasError()) {
1628-
$message = $item->getMessage();
1629-
if (!in_array($message, $errors)) {
1630-
// filter duplicate messages
1631-
$errors[] = $message;
1628+
foreach ($item->getMessage(false) as $message) {
1629+
if (!in_array($message, $errors)) {
1630+
// filter duplicate messages
1631+
$errors[] = $message;
1632+
}
16321633
}
16331634
}
16341635
}

0 commit comments

Comments
 (0)