Qty for some products is showing in negative. I didn't allowed any backorder but still I got the order for such products. My magento version is 18.104.22.168. Can anyone please help me in debugging this issue for why and how stock went into negative even when I didn't allowed for it!
Inventory checks are demanded to
Mage_CatalogInventory module and in particular to
Mage_CatalogInventory_Model_Observer methods, triggered by different events.
Check whether some third party module overrides or disables some of them.
I have seen constellations where qty is negative / < zero in a very small amount of client systems that we did not create from the scratch. The problem is, that the products with negative qty are "in stock/available" and can be bought by shop customers.
Instead of hunting down the reason i simply put a trigger:
delimiter // CREATE TRIGGER negative_stock_to_zero BEFORE UPDATE ON cataloginventory_stock_item FOR EACH ROW BEGIN IF NEW.qty < 0 THEN NEW.qty = 0; END IF; END;// delimiter;
Of course you could also check if backordering is enabled/disabled in the IF-Clause - but thats up to you.