Product in reservation show like out of stock (MAGENTO2 MSI)
-
15-04-2021 - |
質問
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 ?
正しい解決策はありません
他のヒント
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.
所属していません magento.stackexchange