Magento 2 How to use plugin.

When building Magento extension, sometime you have to overwrite core function in magento to have custom function. You can use Rewrite function in magento but it is not good solution. If you don’t want to change core class directly, You can use Magento 2 Plugin because it allows editing the behavior of any public class … Continue reading “Magento 2 How to use plugin.”

How To Use Magento 2 Events and Observers

Magento 2 Events Events are dispatched by Magento 2 Modules whenever specific actions are triggered. When an event dispatches, it passes data to the observer that is configured to watch (or monitor) that event. You can dispatch Magento 2 Events using the Magento\Framework\Event\Manager class. This class can be obtained through dependency injection by defining the dependency in the constructor method of … Continue reading “How To Use Magento 2 Events and Observers”