How can I change the default sort method?

Please note that while we offer this tutorial and it is tested and working at the time of creation, any customization of or support for these types of articles is outside of our scope of support. If you require assistance with any design or customization, we recommend that you either visit our community forums or contact one of our fantastic design partners.

The default sort order for category and brand pages is by Featured Products, which will sort according to the sort order as specified for the products. However, you can change the default sort order to be any of the following:

  • Newest Items
  • Bestselling
  • Alphabetical: A to Z
  • Alphabetical: Z to A
  • Avg. Customer Review
  • Price: Low to High
  • Price: High to Low

1. Click on Design.

2. Click on Edit HTML/CSS.

click edit html/css

3. In the list of Other Template Files on the left, locate and click CategorySortBox.html.

find CategorySortBox.html in template files

Use Ctrl F or Command F to quickly locate template files in the list.

4. Insert name="CategorySortForm" after action="%%GLOBAL_URL%%", as in the screenshot below.

add code to template files

5. Paste the following code at the bottom of the file.

<script type="text/javascript">
if(document.URL == "%%GLOBAL_URL%%") {
document.CategorySortForm.sort[0].selected = "1";
document.forms["CategorySortForm"].submit();
}
else {}
</script>

add script to template file

6. Change the number in document.CategorySortForm.sort[0] to the number in the list below that corresponds with your preferred sort order.

Sort Type Value
Featured Items 0
Newest Items 1
Bestselling 2
Alphabetical (A-Z) 3
Alphabetical (Z-A) 4
Average Customer Review 5
Price (Low to High) 6
Price (High to Low) 7

7. Click Save. Now your categories and brands should sort by your default method. Visit a category on your store, and you should see it load with the new sort order.

Attachments

No attachments were found.

140 votes 51% thumbs up 48% thumbs down

Did this article resolve the issue?

Was this article helpful?

Related Articles

No related articles were found.

Continue
Start your free trial

Start your free, no-risk, 15 day trial

Get your own store up and running in no time. No credit card required.

You can always change your store name later