How can I sort metafield values in ascending or descending order?

Hi,

I have a collection that has filters coming from Metafields. I am using Shopify’s Search and Discovery app. Is there a way that I can sort the values inside the filter? For example, I have a filter named “Cooktop Size”. Its values are like 600mm, 500mm, 900mm, and so on. I want to sort these values in either ascending or descending order. Please see the screenshot below.

Hi @rupeshadh

This app doesn’t support to this featured. You need use an other app or you can refer this article to add Javascript for sort

Unfortunately, you can’t do that kind of sort using liquid.

If you are not against 3rd-party app, you can try this one https://apps.shopify.com/ultimate-search-and-filter-1

It does allow you to manually adding filter option and organize it in whatever order you wanted.

This is a common problem, You can use a PIM, Apimio is one which enables you to map these fields from a centralized dashboard. You can manage variants, add customized descriptions and also save those templates which saves you from going through this process again and again. https://apimio.com you can visit the website for further guidance.

Hi @rupeshadh ,

This is Stacy from the Searchanise Team, the app that offers professional search and filtering capabilities for Shopify stores.

You can easily do it with the help of our app. You can even convert numeric filter into a slider, if you would like to:

Here are detailed instructions on how to set up slider filter: https://docs.searchanise.io/set-up-filters-based-on-product-options-tag-prefixes-metafields/#converting-numeric-filters-by-metafields-into-the-select-filter

I hope it helps.

Best,

Stacy