Using URL Parameter to sort a category page by Discount

Hey
I’ve tried searching the forum to a solution but couldn’t find anything relevant.

I use SEO friendly URLS, like domain.com/on-sale-products/ but want the ability to define a parameter to sort the products when landing on this page by one of the sorting options. ie, sort by highest discount OR lowest price.
Is it possible to define the sorting of a category page by using a parameter like this?
domain.com/on-sale-products/?sort_by=discount-highest or similar.

I’m looking to do this adhoc, so define a sorting for a link in an edm, but other users using the site per normal use the default sorting defined… and not have to change the default sorting for all category pages on the site via the admin settings.

Any help or advice will greatly appreciated.

The following module should help you to define default sorting for this page

Hi!

You can enable the Sort by discount: Low to High and Sort by discount: High to Low at the Available product list sortings section of the Settings > Appearance page. Then, you can add the following parameters to the URL to sort category with this specific type of sorting:

?sort_by=on_sale&sort_order=desc

You can change the sort_order parameter to be desc for descending or asc for ascending.

This is awesome! thanks!.
By chance, do you know the parameter for the following sorts?

  • Sorting by newest first
  • Sorting by lowest price
    Thanks in advance!

?sort_by=timestamp&sort_order=desc

?sort_by=price&sort_order=asc

1 Like