How To
Add Filters To URL
2min
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.
For Example:
- Allow for consistent tracking of selected facets.
- Reusable 'landing page' links
To accomplish this we will add in a custom override module named addFiltersToURL 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
Add the supporting module, addFiltersToURL and apply its use to the page overrides.
Note : The example is set for both Search (landing) and Category (catnav) scopes.
Full Example
Updated 06 Mar 2024
Did this page help you?