Add Filters To URL
There are scenarios when it is useful for the user selected filters and/or merchant preset filters to be captured as part of the SRLP or Category URL.
- Allow for consistent tracking of selected facets.
- Reusable 'landing page' links
To accomplish this we will add in a custom override module that will:
- Intercept the outgoing query
- Analyze the existing URL string
- Update the localstorage of selected facets
- Apply the necessary filters to the outgoing query
- Update the existing URL string
See : for details on preparing for Klevu JS overriding
See : An in-action example and the source code on the Klevu CodeSandbox
Add the supporting modules addFiltersToURL and apply its use(s) to the landing page override.
Note : the same addFiltersToURL module can be used on Category pages by applying the override to the catnav scope as well.