File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
app/code/Magento/CatalogInventory/Model/Quote/Item Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 9
9
10
10
use Magento \CatalogInventory \Api \StockRegistryInterface ;
11
11
use Magento \CatalogInventory \Api \StockStateInterface ;
12
+ use Magento \CatalogInventory \Model \Stock ;
12
13
use Magento \Framework \Exception \LocalizedException ;
13
14
use Magento \CatalogInventory \Api \Data \StockItemInterface ;
14
15
use Magento \CatalogInventory \Helper \Data ;
@@ -133,7 +134,9 @@ public function validate(Observer $observer)
133
134
}
134
135
135
136
if ($ stockStatus ) {
136
- if (!$ stockStatus ->getStockStatus () || $ parentStockStatus && !$ parentStockStatus ->getStockStatus ()) {
137
+ if ($ stockStatus ->getStockStatus () == Stock::STOCK_OUT_OF_STOCK
138
+ || $ parentStockStatus && $ parentStockStatus ->getStockStatus () == Stock::STOCK_OUT_OF_STOCK
139
+ ) {
137
140
$ quoteItem ->addErrorInfo (
138
141
'cataloginventory ' ,
139
142
Data::ERROR_QTY ,
You can’t perform that action at this time.
0 commit comments