I'm having an issue with the inventory of some of my stores, some products are going to 0 qty in stock, and still available. I have two catalog logger modules installed, and none of them can catch this "to 0 update".

The problem is not the stock status, the product should be available because there is no order/change, but for some reason the quantity was set to 0.

As you can see on the image below, the product have its stock changed from 0 to 1 at day "23", and 2 weeks later, its stock changed from "0 to 1" again. There is no log of the change from "1 to 0".

Print of stock changes logger

These are the events that my logger modules observe:

  • catalog_product_save_after
  • cataloginventory_stock_item_save_after
  • order_cancel_after
  • checkout_submit_all_after
  • cataloginventory_stock_revert_products_sale
  • sales_order_payment_refund

What I've already checked/know:

  • Backorders settings
  • There is no orders with those items
  • No refunds
  • This happens with all kind of products (simple, configurable, bundle)
  • Inventory updates via API is register by the logger module

Extra Info:

  • Magento version: 1.5 (yeah, i know its old =/)

I've solved the problem.

  • Magento uses an catch block to set qty back to stock in case of errors in order creation

An custom payment module was exiting the code in case of errors (exit;) And didn't let Magento set the qty back in stock. Just removed the exit and add an ThrowException;

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.