Skip to content

Commit d040afd

Browse files
committed
ACP2E-4192: [Cloud] Stock limit exceeded notification message is displayed twice when Out-of-Stock Threshold is hit
1 parent 588eac3 commit d040afd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/code/Magento/Checkout/Controller/Cart/UpdatePost.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ protected function _updateShoppingCart()
8484
}
8585
} catch (\Magento\Framework\Exception\LocalizedException $e) {
8686
$this->cart->save();
87-
$this->messageManager->addErrorMessage(
88-
$this->_objectManager->get(\Magento\Framework\Escaper::class)->escapeHtml($e->getMessage())
89-
);
87+
// We do not add an error message to messageManager here to prevent duplicate error messages
88+
// on the cart page. The frontend AJAX validation already displays this error, and the backend message
89+
// would cause duplication after page reload.
9090
} catch (\Exception $e) {
9191
$this->messageManager->addExceptionMessage($e, __('We can\'t update the shopping cart.'));
9292
$this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e);

0 commit comments

Comments
 (0)