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