How to hide specific 'sort by' options in Dawn 2.0 theme?

Solved

How to hide specific 'sort by' options in Dawn 2.0 theme?

Gumf
Shopify Partner
26 1 1

Hi 

 

I am using the theme Dawn 2.0 and I am trying to hide the 'sort by Price' and 'sort by Date' fields from the collection page sort by dropdown menu. I have tried some solutions but can't seem to get any to work.

 

Gumf_0-1677524802671.png

 

Any help would be massively appreciated.

 

Thank you

Accepted Solution (1)

GemPages
Shopify Partner
5625 1261 1240

This is an accepted solution.

Hello @Gumf ,

 

You can follow these steps: 
1. Go to Online Store->Theme->Edit code

GemPages_0-1677559434362.png

2. Open your theme.liquid file, paste the below code before </body>

GemPages_1-1677559458657.png

  
    <style>
      .facet-filters__field .select__select option[value="price-descending"],
      .facet-filters__field .select__select option[value="price-ascending"],
      .facet-filters__field .select__select option[value="created-ascending"],
      .facet-filters__field .select__select option[value="created-descending"]{
         display: none;
      }
    </style>

I hope the above is useful to you.


Kind & Best regards, 
GemPages Support Team

GemPages - Build any high-converting store pages for any business


- If you find my reply helpful, please hit Like and Mark as Solution
- Get connected: App Store | Blog | Community | Help Center

View solution in original post

Replies 8 (8)

PageFly-Victor
Shopify Partner
7865 1785 3094

Hi @Gumf ,

Could you please share URL and your store password? So that we can help you.
Thank you.

GemPages
Shopify Partner
5625 1261 1240

This is an accepted solution.

Hello @Gumf ,

 

You can follow these steps: 
1. Go to Online Store->Theme->Edit code

GemPages_0-1677559434362.png

2. Open your theme.liquid file, paste the below code before </body>

GemPages_1-1677559458657.png

  
    <style>
      .facet-filters__field .select__select option[value="price-descending"],
      .facet-filters__field .select__select option[value="price-ascending"],
      .facet-filters__field .select__select option[value="created-ascending"],
      .facet-filters__field .select__select option[value="created-descending"]{
         display: none;
      }
    </style>

I hope the above is useful to you.


Kind & Best regards, 
GemPages Support Team

GemPages - Build any high-converting store pages for any business


- If you find my reply helpful, please hit Like and Mark as Solution
- Get connected: App Store | Blog | Community | Help Center
Gumf
Shopify Partner
26 1 1

This worked perfectly, thank you so much!

IEakin
Visitor
1 0 0

Hello, 

 

This coding works for me to get rid of things in the right place, but what text do I use to rid of these in the sort by drop down menu? (I want to keep: price, low to high and price, high to low) 

-featured

-best selling

-alphabetically, A-Z

-alphabetically, Z-A

-date, old to new

-date, new to old

NG5
New Member
5 0 0

Did you end up finding the id for the remaining fields? would be useful to know what they are, thanks.

NG5
New Member
5 0 0

<style>

.facet-filters__field .select__select option[value="best-selling"],
.facet-filters__field .select__select option[value="created-ascending"],
.facet-filters__field .select__select option[value="created-descending"]

display: none;
}
</style>

StoreWatchers
Trailblazer
205 30 37

Hello @Gumf,

 

Greetings from the Store Watchers Support Team! Happy to help you today.

 

Go to Online Store -> Actions -> Edit code. Then find theme.liquid.

 

online-store.JPG

In the search field, type facets.liquid. Then open the file. In line 319, please update the select tag with the below code.

 

<select name="sort_by" class="facet-filters__sort select__select caption-large" id="SortBy" aria-describedby="a11y-refresh-page-message">
{%- for option in results.sort_options -%}
{%- unless option.name contains 'Price' or option.name contains 'Date' -%}
<option value="{{ option.value | escape }}"{% if option.value == sort_by %} selected="selected"{% endif %}>{{ option.name | escape }}</option>
{% endunless %}
{%- endfor -%}
</select>

 

Please check the screenshot below for your reference.

 

screenshot.JPG

Let me know if need further assistance

Regards,
Store Watchers Support Team

StoreWatchers - Automate testing for your Shopify store in seconds


If you find my reply helpful, please hit Like and Mark as Solution
Visit us: App Store | Website | FAQs

Lin22da
New Member
9 0 0

Does anyone know the excactly field id of the "best selling" option?

Thanks a lot!