How do I remove certain Sort by options on Brooklyn theme?

Solved
Highlighted
Explorer
58 0 11

Hello,

 

How do I remove Sort by the following options on Brooklyn theme

 

  • Alphabetically, A-Z
  • Alphabetically, Z-A
  • Featured
  • Date, old to new
  • Date new to old and
  • Best selling

sort.PNG

0 Likes
Highlighted
Shopify Partner
2282 498 647

Hey there,

 

For that you will have to modify liquid code.

You want to keep price high and low option there, right ?

 

So you will have to modify snippets/collection.sorting.liquid file.

Thanks!

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
0 Likes
Highlighted
Explorer
58 0 11

Hi again,

 

Yes I would like to keep those two but how do I do that?

 

New to shopify.



 

0 Likes
Highlighted
Shopify Partner
2282 498 647

Hey,

 

Ok but as you are new are you able to modify liquid code ?

I will provide you code, if you need.

 

Thanks!

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
0 Likes
Highlighted
Explorer
58 0 11

Yes, I can modify it given the instructions of what to add/remove exactly

 

Thank you

0 Likes
Highlighted
Shopify Partner
2282 498 647

This is an accepted solution.

Ok then goto snippets/collection-sorting.liquid file.

 

Search for following code

<select name="sort_by" id="sortBy" aria-describedby="a11y-refresh-page-message a11y-selection-message" class="filter-dropdown__select">
      {% for option in collection.sort_options %}
        <option value="{{ option.value }}"{% if sort_by == option.value %} selected="selected"{% endif %}>{{ option.name }}</option>
      {% endfor %}
    </select>

Replace above code with this new code

<select name="sort_by" id="sortBy" aria-describedby="a11y-refresh-page-message a11y-selection-message" class="filter-dropdown__select">
      {% for option in collection.sort_options %}
      	{% if option.value !='best-selling' and 
        option.value !='manual' and 
        option.value != 'title-ascending' and 
        option.value != 'title-descending' and 
        option.value != 'created-ascending' and 
        option.value != 'created-descending' %}
        <option value="{{ option.value }}"{% if sort_by == option.value %} selected="selected"{% endif %}>{{ option.name }}</option>
        {% endif %}      
      {% endfor %}
    </select>

Thanks!

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
0 Likes
Highlighted
New Member
8 0 0

Hi I need availability low to high and high to low option in sort by menu please share code 

0 Likes
Highlighted
Explorer
54 0 16

Hi @dmwwebartisan 

I would like to do the same but I have Empire theme and can't seem to find snippets/collection-sorting.liquid file or anything similar to it that contains ("sort by")

0 Likes