Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento event on stock change?

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

like image 512
mfrosch Avatar asked Nov 20 '12 08:11

mfrosch


People also ask

What is dispatch event in Magento 2?

In Magento 2, events can be dispatched using the Magento\Framework\Event\Manager class. While developing a custom extension, we need to create a custom dispatch event, so in future, if any other developer needs to extend functionality at that time they can use this dispatch event.

What is event observer in Magento?

Observers are a certain type of Magento class that can influence general behavior, performance, or change business logic. Observers are executed whenever the event they are configured to watch is dispatched by the event manager.


1 Answers

cataloginventory_stock_item_save_commit_after gets triggered on sale.

like image 137
Alex Avatar answered Sep 29 '22 10:09

Alex