How to Change Magento 2 Functionality 03/10 | Magento 2 Tutorials for Beginners (2020) | MageCafe
Learn how to make changes in Magento 2 core functionality without actually touching the Magento core.
For more Details:
In this video, we explain about Plugins, Observers, Preference, and Events.
Plugins: Plugins, also known as Interceptors is a class that can modify the output of public functions on three occasions such as before, after and around the function execution. Plugins are called in di.xml file.
Observers: Observers can be interpreted as event watchers. The observer class watches for a dispatched event and executes some custom functionality on the data that the event has passed. Observers classes are called from events.xml file. We need to specify the event name and the observer class that will execute during event dispatch.
Preferences: Preferences let you substitute a class in place of another class inside Magento 2. Preference is also called from di.xml file. Preferences are very powerful except for one major drawback, that is the same class cannot be rewritten by two modules.
Events: Events are dispatched by modules when certain actions are triggered. In addition to its own events, Magento allows you to create your own events that can be dispatched in your code. When an event is dispatched, it can pass data to any observers configured to watch that event.
There are many ways to learn Magento and Magecafé is definitely one the best.
MageCafé by Codilar(www.codilar.com) is a series of Magento tutorial videos aimed at helping Magento developers all over the world.
We are a Magento development company headquartered in Bengaluru, India. To know more about us visit our website:
Read our blogs:
Connect us on Facebook:
Connect us on LinkedIn:
Connect us on Twitter: