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?
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024