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
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.
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.
cataloginventory_stock_item_save_commit_after
gets triggered on sale.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With