How to handle some special cases
On this page
Use product URL instead of collection URL
By default USF uses collection URL like mystore.com/collections/cool/my-product
to navigate to a product when user clicks on an item. You can change it to product URL by setting usf.platform.useProductsUrl = true
(add this to the init function).
Get current collection
You can get the current collection URL name in USF using usf.platform.collection
. If you need to get the collection object which contains collection title, sort order, and description, use usf.collectionsByUrlName[usf.platform.collection]
Refresh the search result
If you use an AJAX pager to switch between collection pages, you can call usf.search.refresh()
to refresh the search result after you switched to a new page. If you got any error, your store may have the old version of our Javascript API. In this case, please contact our team for help.