Overriding or Extending Functionalities
In order to extend Nosto, we can create a new Magento 2 module that will override the vendor
files.
Directory Structure
Creating an override requires a few files to be created. Follow the guide below and simply copy-paste the content into the specified locations. This will form the scaffold of your new override.
1. The module config app/code/My/Nosto/etc/module.xml
app/code/My/Nosto/etc/module.xml
2. The module registration app/code/My/Nosto/registration.php
app/code/My/Nosto/registration.php
3. The composer app/code/My/Nosto/composer.json
app/code/My/Nosto/composer.json
You now should have this directory structure:
Enabling the plugin
Before the module begins to work, you will need to explicitly enable the module by running a series of commands.
Disabling the plugin
In order to disable the module without removing the code, you will need to run a series of commands.
The changes you make will be taken into use instantly both in the shop.
Verifying
Once you have overridden the associated model and customised whatever fields you may need, you should verify that it, in fact, working as expected.
NOTE: Please note that in order to verify the changes using the debug-toolbar, you must have a Nosto account for the given store.
Using the module in production environment
Last updated
Was this helpful?