Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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.
Any help would be massively appreciated.
Thank you
Solved! Go to the solution
This is an accepted solution.
Hello @Gumf ,
You can follow these steps:
1. Go to Online Store->Theme->Edit code
2. Open your theme.liquid file, paste the below code before </body>
<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
Hi @Gumf ,
Could you please share URL and your store password? So that we can help you.
Thank you.
This is an accepted solution.
Hello @Gumf ,
You can follow these steps:
1. Go to Online Store->Theme->Edit code
2. Open your theme.liquid file, paste the below code before </body>
<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
This worked perfectly, thank you so much!
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
Did you end up finding the id for the remaining fields? would be useful to know what they are, thanks.
<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>
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.
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.
Let me know if need further assistance
Regards,
Store Watchers Support Team
Does anyone know the excactly field id of the "best selling" option?
Thanks a lot!
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025