Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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
languagejs
/**
 *
 * @type {MenuComponent}
 */
const component = ComponentFactory.get(MenuComponent);

Plugin Type and Running Order

Please read in Magento Plugin

...

  1. We use this to reference to original object of plugin class. So, we don't need $subject like Magento

  2. Each plugin (after, before, around) is a function

Exercise: Use plugin to change all product image in product list to Magestore Logo