Magento event on stock change?
Asked Answered
M

1

8

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

Monoacid answered 20/11, 2012 at 8:55 Comment(0)
S
2

cataloginventory_stock_item_save_commit_after gets triggered on sale.

Sexless answered 20/11, 2012 at 12:10 Comment(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)Wyckoff
@fab could you show me how config for "the sale triggered stock notifications"?Babism
@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 triggeredWyckoff

© 2022 - 2024 — McMap. All rights reserved.