Skip to main content

sort_by

string | sort_by: string
returns string

Generates a collection URL with the provided sort_by parameter appended. This filter must be applied to the object property collection.url.

Accepts the following values:

  • manual (as defined in the collection settings)
  • best-selling
  • title-ascending
  • title-descending
  • price-ascending
  • price-descending
  • created-ascending
  • created-descending

Tip

You can append the sort_by filter to the url_for_type and url_for_vendor filters.


{{ collection.url | sort_by: 'best-selling' }}

Output

/collections/sale-potions?sort_by=best-selling
Was this page helpful?