Sorting Results In Search and Categories

Check how to choose a custom attribute to sort results

Per standard, sorts results in Search and Categories based on what most customers will be likely to buy, which is a great conversion booster.

However, the Search API and the Category Popular API has a built-in function that allows you to choose a specific attribute to sort by, which will still list products based on popularity, but at the same time sort them based on the attribute you select. 

Here is an example:

<span class="clerk"
      data-query="running shoes"

data-orderby lets you choose the attribute to filter by. Any attributes sent to can be used for this.

data-order can be either asc or desc for ascending and descending order.

The sorting can also be used in direct API calls: