7

is there an event whenever the stock quantity of an product is changed?

I tried:

cataloginventory_stock_item_save_after
_after and _before.

But this event only get triggerd if product is saved, but not on sell or order cancel.

So is there a convinient event for this?

Thanks and cheers, Matthias

René Höhle
  • 26,716
  • 22
  • 73
  • 82
mfrosch
  • 131
  • 1
  • 5

1 Answers1

2

cataloginventory_stock_item_save_commit_after gets triggered on sale.

Alex
  • 32,506
  • 16
  • 106
  • 171
  • 3
    It looks like that only holds true if the sale triggered stock notifications, otherwise the stock model is optimized to update the stock quantity in a single query which triggers no event (Magento CE 1.7) – Fabian Schmengler Jan 19 '14 at 23:24
  • @fab could you show me how config for "the sale triggered stock notifications"? – Lan Nguyen May 09 '14 at 03:08
  • @HoangLan it is not about configuration. The stock qty can change if items are sold (=> triggered by sale) or on other occasions like when you set it in the backend, then the event is not triggered – Fabian Schmengler May 09 '14 at 18:49