Use the Manually sorting order from Shopify

shopify

#1

Hej Algolia Community

I make making a shop, where under one of the collection they want some product in a specific order. So not after create date or anything else. That way they can control what the costumer will see first.

But i don’t seems like that order have been make into an indices in my indices page.

Is there way to make sure that the order will be made into an indec or pull it out from Shopify live?

I have added images of what i mean here:
https://imgur.com/a/WakVxOg

I know that the collection is named “New arrival” but the order is not after the newest arrival in the database.

I hope you can help :slight_smile:

Peter.


Sorting items in collection in Shopify
#2

Hi,

Thanks for reaching us. I am Alex developer at Algolia, working on the Shopify Integration. :slight_smile:

Just to be sure you want to control the order on the collection page of “new arrivals” ?! Is that what you mean ? If that is the case you could set up Query Rule on specific collection page :

The Merchandising Tool has not being designed to works with the “Collection search page” feature.
In order to create Query Rule on a specific collection page, for example, having a specific product at the first place for the “Dresses” collection, you will have to follow those steps:

  1. Update your theme’s instant search code to provide Query Rule context
    Go to your theme code via the Shopify Admin and edit the algolia_instant_search.liquid.js file.
    You will have to add a custom code snippet in the “searchFunction” (around line 48).
    Just before the line: “helper.setPage(page);”, add the following:
    if (!!collectionFacetValue) {
    helper.setQueryParameter(‘ruleContexts’, [ collectionFacetValue ]);
    }

Then save the file.

  1. Go to your Algolia Dashboard and create a Query Rule

Now that the instant search code will send us a Query Rule Context for each query that comes from a collection page, we can create collection specific query rules.
In order to do so, you will have to provide a context to the Query Rule, by putting the “slug” of the targeted collection.

You can find the slug of the targeted collection in the URL of your shop, for example: https://myshop.myshopify.com/collections/dresses-winter

Once the context filled, just add consequences (promote a result) and then save the Query Rule.

Thanks,

Alex


Shopify - Manually order specific collection
#3

Just to point out for anyone thinking of using this approach that you end up duplicating products and/or losing products for the collection where they have been pinned by using query rules.

I’d be interested in getting the manual sort from Shopify instead as per the original request on this email and that way we can use existing merchandising tools on our store. How can we achieve this?

Thanks,
Trevor