0

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 ?

1 Answer 1

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.