1

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 1.8.1.0. 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!

  • I suggest looking at the orders / refunds etc that have occured on the product. Remember that it is possible for you to manually set a negative stock in magento. See if you can narrow it down to a specific action by reviewing the orders with it, going one at a time untill you see which action(s) triggered the negative. – John Cuthbert Jan 15 '16 at 12:24
  • @JohnCuthbert: can you please elaborate a bit the steps to be followed so as to reproduce the stuffs what you said! – Anurag Khandelwal Jan 15 '16 at 12:37
  • Did you try to add a new product, set stock to 1 and try to order 2 or more? Is it possible to order that product then? – Arjen Miedema Jan 15 '16 at 12:55
  • @ArjenMiedema: Yes, I did tried, but it doesn't allows me to order more then what is available in-stock – Anurag Khandelwal Jan 15 '16 at 13:43
0

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.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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