Shopify themes, liquid, logos, and UX
Hello,
I'm using the debut theme and want to remove 'Featured, Best Selling, Date old to new, Date new to old' options. Please can someone help?
Thanks
Solved! Go to the solution
This is an accepted solution.
Add following code
{%- for option in collection.sort_options -%}
{% unless option.value == 'manual' or option.value == 'best-selling' 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 -%}
{% unless option.value == 'manual' or option.value == 'title-ascending' or option.value == 'title-descending' or option.value=='created-ascending' or option.value == 'created-descending' %}
{%- 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 how this goes and if there is anything else I can assist you with, I'm happy to help!
All the Best,
I ended up just copying your final code near line 108 which kind of worked, but I am missing the Alphabet A - Z and Z - A option, and it is still showing 'Best selling' which I want removed
thanks
Please share your orignal liquid code .
Thanks!
Below was the original line 108 to 115.
{%- for option in collection.sort_options -%}
<option value="{{ option.value }}" {% if option.value == sort_by %}selected="selected"{% endif %}>{{ option.name }}</option>
{%- endfor -%}
</select>
{% include 'icon-chevron-down' %}
</div>
</div>
{% endif %}
Below is the new 108 to 115 as per your code.
{%- 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 -%}
</select>
{% include 'icon-chevron-down' %}
</div>
</div>
Thanks for code . please share your shop URL!
This is an accepted solution.
Add following code
{%- for option in collection.sort_options -%}
{% unless option.value == 'manual' or option.value == 'best-selling' 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 -%}
It worked! thank you so much!
thank you for this. its worked
Do I delete any code before adding this code?
Please share your Sections / collection-template.liquid file code
Thanks!
Hi! This is my current drop down. However, I want to add Date, New to Old and Date, Old to New.
Can you please help me?
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024