Magento 2 - InstantSearch.js Category Page


I’m implementing and seeking advice on how best to make modifications to the Instant Search “Category” Refinement Filter only to:

  1. Only display Parent, Sibling and Child categories of current Category (eg Aunty and Uncle should not be displayed)
    > Parent > Current > Child
    > Parent > Sister > Child
    > Parent > Brother > Child
    > Aunty > ...
    > Uncle > ...

  2. For displayed categories - Force their URLs to open and not include carry across refinement URL parameters. ie if click on category (clear all refinements)

Hope I’m making sense.

Thanks in advance.


Hello Daniel (@web1),

First point:
If I understand correctly, you can specify a different rootPath for hierarchical menu (categories) widget (filter).
To do that, you can use the extensions’s algoliaHookBeforeWidgetInitialization front-end hook to modify configuration of the widget.

Second point:
Unfortunately today there is no option how to specify a URL structure on instant search pages. It’ll be coming in the next version of the extension. There you’ll be able to programatically define the structure of URL.