Question

I have stock_qty = 2 and salable_qty = 0 because of my products reservations and when I open product page add To Cart exists. Can this product show like out of stock when salable qty is 0 ?

No correct solution

OTHER TIPS

That is indeed the default Magento behavior, but you could alter it by adding an after plugin on isAvailable() method from the Magento\Catalog\Model\Product class and inside it, you could interrogate the isSalable() method from Magento\InventorySalesApi\Api\AreProductsSalableInterface service (as Magento\InventorySalesApi\Api\IsProductSalableInterface is now marked as deprecated) to double- check if the product is really available.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top