Skip to content

Commit

Permalink
Fix non unique messages shown when adding items to cart
Browse files Browse the repository at this point in the history
  • Loading branch information
volodyaprokopchuk committed Nov 29, 2016
1 parent 6619bdf commit c5699b9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/code/Magento/Quote/Model/Quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -1619,10 +1619,11 @@ public function addProduct(

// collect errors instead of throwing first one
if ($item->getHasError()) {
$message = $item->getMessage();
if (!in_array($message, $errors)) {
// filter duplicate messages
$errors[] = $message;
foreach ($item->getMessage(false) as $message) {
if (!in_array($message, $errors)) {
// filter duplicate messages
$errors[] = $message;
}
}
}
}
Expand Down

0 comments on commit c5699b9

Please sign in to comment.