How can I change the default sort method?

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered
  • (Edited)
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 HTLM/CSS.

click edit htmlcss

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

find CategorySortBoxhtml 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 TypeValueFeatured Items0Newest Items1Bestselling2Alphabetical (A-Z)3Alphabetical (Z-A)4Average Customer Review5Price (Low to High)6Price (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.

Photo of Drew N

Drew N, Community Manager

  • 251,594 Points 100k badge 2x thumb

Posted 4 years ago

  • 0
  • 1

Be the first to post a reply!