Question

For some "Special" products in a webshop I want to use Backorder stock instead of actual stock which is available for those products but not sure how to proceed with it.

I have looked into MAGE_CATALOGINVENTORY_STOCK_ITEM and its functions CheckQty() and VerifyQty() but still do not how shall I tell Magento to not use actual stock when I place order for those products. Because I do not want Magento to reduce the stock for them. Also I am not sure if I do it in an event or by overriding MAGE_CATALOGINVENTORY_STOCK_ITEM class.

I be very grateful if someone can give me ideas or share some code regarding this.

No, I have not written any code so far as I am not sure how to proceed with it.

Était-ce utile?

La solution

The challenge was not to reduce the the product stock if Pre-order mode is selected. As same product can be both Pre and Re-order product. So to keep the stock information same for the product I have to override few function of cataloginventory_stock_item class.

The functions which I override are: verifyStock subtractQty verifyNotification

On the other hand one can look into registerProductsSale function who subtracts product quantity from stock.

Or can use subtractQuoteInventory function of an observer which according to Magento Also called after every successful order placement to ensure subtraction of inventory

Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange
scroll top