During the search/filtration process there are many event occurs where we might require to inject our frontend logic to change the default behaviour. Wizzy Magento 2 Extension provides frontend event hooks which can be implemented to modify the default behaviour or modify the parameters.
To see the supported event hooks, check the following file.
You can implement the event hooks in very simple process,
- Create new file under
In this file you can register any required hooks from the list to modify the config or the store behaviour. To register a hook use global wizzy variable and it’s function registerEvent. If you would like to use jQuery or any other library as dependency in these hooks implementation make sure you add them in requirejs.
Something like this,
- Register event takes 2 parameters. One is the event type and second is callback function.
- After modifying the given parameters from callback function you must return the same.