File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
CatalogInventory/Model/Quote/Item Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -183,13 +183,6 @@ public function validate(\Magento\Framework\Event\Observer $observer)
183
183
\Magento \CatalogInventory \Helper \Data::ERROR_QTY ,
184
184
$ result ->getMessage ()
185
185
);
186
-
187
- $ quoteItem ->getQuote ()->addErrorInfo (
188
- $ result ->getQuoteMessageIndex (),
189
- 'cataloginventory ' ,
190
- \Magento \CatalogInventory \Helper \Data::ERROR_QTY ,
191
- $ result ->getQuoteMessage ()
192
- );
193
186
} else {
194
187
// Delete error from item and its quote, if it was set due to qty lack
195
188
$ this ->_removeErrorsFromQuoteAndItem ($ quoteItem , \Magento \CatalogInventory \Helper \Data::ERROR_QTY );
Original file line number Diff line number Diff line change @@ -108,12 +108,20 @@ public function prepareItemUrls()
108
108
}
109
109
110
110
/**
111
- * @codeCoverageIgnore
112
111
* @return bool
113
112
*/
114
113
public function hasError ()
115
114
{
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 ;
117
125
}
118
126
119
127
/**
You can’t perform that action at this time.
0 commit comments