How can I modify sort options in Abode 3.0.3 theme's default collection page?

nishak69
Shopify Partner
1 0 0

I'm Using theme Abode 3.0.3 
In default collection page there is a feature called sort by>>
Under this sort by there are few options like Featured,Alphabaticallt,A-Z,Alphabaticallt,Z-A,Date,old to new,Date,new to old

i want to remove this options and keep only Best Selling,Price:High to low,Price:Low to High,New In
but i don't know how to do this...can anyone help me implementing this?

Reply 1 (1)

WebDeskSolution
Shopify Partner
172 42 49

Hello @nishak69 

 

There is no option to add and remove available directly through the theme customizer or any setting but you can achieve that by doing some of the code and adding conditions into the file. Please follow the steps below to add examples of conditions:

 

Step 1: Go to admin and open the theme code editor

Step 2: Find facets.liquid snippets file or if a file is not available then you can find code under main-collection-product-grid.liquid section file.

Step 3: Search for results.sort_options for loop code.

Step 4: add if condition under for loop and wrap option tag under it like

{%- for option in results.sort_options -%}
	{% if option.name == 'Best selling'
		or option.name == 'Price, low to high'
		or option.name == 'Price, high to low' %}
	  <option
	    value="{{ option.value | escape }}"
	    {% if option.value == sort_by %}
	      selected="selected"
	    {% endif %}
	  >
	    {{ option.name | escape }}
	  </option>
  	{% endif %}
{%- endfor -%}

 

You can add more options to the if condition if you want to display other sorts by options like "Date, old to new", "Date, new to old" etc.

 

Step 5: Finally, hit the save button and check for the result on the frontend product listing page.

 

Please hit Like and Mark it as a Solution if you find our reply helpful.

 

 

Thank You,


WebDesk Solution Support Team
Get a Free Quote | Email | Shopify Partner | Shopify Development Agency | Call Us 877.536.3789


Location: 150 King St. W. Toronto, ON M5H 1J9