By default the Shopify category pages are using collection_ids
as category page identifier.
To have a more accessible interface to merchandize your categories, we advise to change the category page identifier to collections
. You can find the steps to implement this below.
1. Add a facet:
Add a custom facet called 'collections' with the Shopify-Algolia integration and set it as hidden and searchable:
2. Change the category page identifier:
You can configure the category page identifier on your Merchandising studio settings. To do this, go to Merchandising Studio > Settings > Category Page Identifiers and change the Category Page Identifier to collections
3. Change your front end code:
Assuming you are using the default Algolia InstantSearch integration for Shopify, then you will need to change your front end code to make sure the filters
is set to collections: "collection_name"
. Otherwise, your collection Search page wouldn't work as expected.
To change this, please locate the algolia_instant_search.js.liquid
file and change this conditional statement
From:
if (algolia.config.collection_id_indexing) {
collectionFacetFilter = algolia.current_collection_id
? 'collection_ids:"' + algolia.current_collection_id + '"'
: null;
} else {
collectionFacetFilter = 'collections:"' + collectionHandle + '"';
}
To:
if (algolia.config.collection_id_indexing) {
collectionFacetFilter = collectionHandle
? 'collections:"' + collectionHandle + '"'
: null;
} else {
collectionFacetFilter = 'collections:"' + collectionHandle + '"';
}
Then, on your collection pages you should be able to see this filter being applied: