Add Pagination To URL
There are times when it is beneficial to have the users selected pagination captured and stored as part of the URL.
For Example :
- Allow for consistent tracking of the selected page of results.
- 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 page value
- Apply the page offset to the outgoing query
- Update the existing URL string
See : Custom Overrides for details on preparing for Klevu JS overriding
Add the supporting module addPaginationToURL and apply it to the landing page override.
Note : the same addPaginationToURL module can be used on Category pages by applying the override to the catnav scope as well.