Skip to content

Commit b9e0026

Browse files
committed
MAGETWO-54262: Cannot remove product from shopping cart
1 parent 65eb8de commit b9e0026

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,6 @@ public function validate(\Magento\Framework\Event\Observer $observer)
183183
\Magento\CatalogInventory\Helper\Data::ERROR_QTY,
184184
$result->getMessage()
185185
);
186-
187-
$quoteItem->getQuote()->addErrorInfo(
188-
$result->getQuoteMessageIndex(),
189-
'cataloginventory',
190-
\Magento\CatalogInventory\Helper\Data::ERROR_QTY,
191-
$result->getQuoteMessage()
192-
);
193186
} else {
194187
// Delete error from item and its quote, if it was set due to qty lack
195188
$this->_removeErrorsFromQuoteAndItem($quoteItem, \Magento\CatalogInventory\Helper\Data::ERROR_QTY);

app/code/Magento/Checkout/Block/Cart.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,20 @@ public function prepareItemUrls()
108108
}
109109

110110
/**
111-
* @codeCoverageIgnore
112111
* @return bool
113112
*/
114113
public function hasError()
115114
{
116-
return $this->getQuote()->getHasError();
115+
if ($this->getQuote()->getHasError()) {
116+
return true;
117+
}
118+
119+
foreach ($this->getQuote()->getItems() as $quoteItem) {
120+
if (!empty($quoteItem->getErrorInfos())) {
121+
return true;
122+
}
123+
}
124+
return false;
117125
}
118126

119127
/**

0 commit comments

Comments
 (0)