2.8 (56.92%) 13 votes

As you know, I had a guide “How to use Magento 2 events” before.

  • Now I will help you how to create an event in your extension for Magento 2.
  • This guide is so easy to do, so let’s enjoy it with these easy steps.
  • Now I have a simple example:

As you can see it’s fairly straightforward to dispatch the event from almost anywhere in Magento 2.3. The first argument of the dispatch method is the name of the event and the second argument is used to pass the data to observers.

You may want to try the Magento 2 Demo to fully experience its new awesome features. And of course, please feel free to find more Magento 2 Tutorials by our Experts.

How to use Magento 2 event? - Magento 2.3
How to Get Value of Custom Attribute on Magento 2 Rest API? - Magento 2.3

Leave a Reply

Your email address will not be published. Required fields are marked *