File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
app/code/Magento/CatalogInventory/Model/Quote/Item Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -157,11 +157,13 @@ public function validate(Observer $observer)
157157 if ($ stockStatus ->getStockStatus () === Stock::STOCK_OUT_OF_STOCK
158158 || $ parentStockStatus && $ parentStockStatus ->getStockStatus () == Stock::STOCK_OUT_OF_STOCK
159159 ) {
160- $ quoteItem ->addErrorInfo (
161- 'cataloginventory ' ,
162- Data::ERROR_QTY ,
163- __ ('This product is out of stock. ' )
164- );
160+ if (!$ quoteItem ->getStockStateResult () && !$ quoteItem ->getStockStateResult ()->getHasError ()) {
161+ $ quoteItem ->addErrorInfo (
162+ 'cataloginventory ' ,
163+ Data::ERROR_QTY ,
164+ __ ('This product is out of stock. ' )
165+ );
166+ }
165167 $ quoteItem ->getQuote ()->addErrorInfo (
166168 'stock ' ,
167169 'cataloginventory ' ,
You can’t perform that action at this time.
0 commit comments