I'm using a popular dropship module that uses the Magento inventory as the local inventory and when an item is not available locally (is_in_stock = 0
) items get assigned to various vendors. So the is_in_stock = 0
status needs to be preserved and not just overwritten to return true.
What should be changed in Magento so that is_in_stock = 0
can be purchased?
By Default - if you try to add an item with (is_in_stock = 0
) to your cart, Magento will stop you with this message: This product is currently out of stock.
I found the 2 files that trigger that message.
app\code\local\Mage\CatalogInventory\Model\Stock\Item\Item.php
app\code\local\Mage\CatalogInventory\Model\Observer.php
By modifying the observer.php
, I'm able to successfully add an is_in_stock = 0
item to the cart and check out but I'm not sure this is the best way. I also noticed when viewing the order in the admin area, the item details don't show up but the item totals do.
I just added one line of code to the observer.php
that skipped the step which checked for if (!$stockItem->getIsInStock()
.