changing sort by on debut theme

ronsiboy
New Member
3 0 0

hi 

am trying to reduce the number of sort by options on my product and collection pages. I want to get rid of alphabetical and date options

thank you for your help

 

0 Likes
JHKCreate
Shopify Partner
2052 334 448

Hi There!

You're using the default collection listing correct? Let me know so I can tell you where to remove the extra options. 

- Did we solve your issue? Like & Mark As Solution to help the community
- Should you need any direct help: contact@jhkcreate.com
0 Likes
ronsiboy
New Member
3 0 0

yes in default I would like to alter the sort to show by low-high and high-low only, thank you

0 Likes
JHKCreate
Shopify Partner
2052 334 448

In your collection-template.liquid file under "Sections" look for:

{%- for option in collection.sort_options -%}


And add the following after it:

{% unless option.value == 'manual' or option.value == 'title-ascending' or option.value == 'title-descending' or option.value=='created-ascending' or option.value == 'created-descending' %}
<option value="{{ option.value }}" {% if option.value == sort_by %}selected="selected"{% endif %}>{{ option.name }}</option>
{% endunless %}


Your code section should look like:

{%- for option in collection.sort_options -%}

{% unless option.value == 'manual' or option.value == 'title-ascending' or option.value == 'title-descending' or option.value=='created-ascending' or option.value == 'created-descending' %}
<option value="{{ option.value }}" {% if option.value == sort_by %}selected="selected"{% endif %}>{{ option.name }}</option>
{% endunless %}

{%- endfor -%}


Let me know if I missed something in the filters Cheers!

- Did we solve your issue? Like & Mark As Solution to help the community
- Should you need any direct help: contact@jhkcreate.com
ronsiboy
New Member
3 0 0

hi,

I am using the latest version of Debut maybe that makes a difference? I did what you recommended and it gave me doubles of the best selling, high -low, low-high but did not delete the other categories?

Thx your help

0 Likes
Rotemples
Tourist
3 0 1

Thank you. It worked very well.

0 Likes