A module can modify a method of a class from core
or other module
.
Config Plugin
In the module, we register a plugin in file etc/config.js
.
...
Code Block | ||
---|---|---|
| ||
/** * * @type {MenuComponent} */ const component = ComponentFactory.get(MenuComponent); |
Plugin Type and Running Order
Please read in Magento Plugin
...
We use
this
to reference to original object of plugin class. So, we don't need$subject
like MagentoEach plugin (after, before, around) is a function
Exercise: Use plugin to change all product image in product list to Magestore Logo