Shopify themes, liquid, logos, and UX
I want to customize the Sort By options in my product collection. Add a "Discounted Products" sort option to show items with discounts first. Remove the "Alphabetical Order" sort option from the list. I'm currently using the Ella theme. Rivaaj Ethnic
Hi,
In this theme we have no option to customize this short option as its generating by Shopify.
But we can do some custom code to remove some option.
Like this:
1. Open Section->collection-template.liquid and then find 'collection.sort_options'
Now add unless condition like below so they can remove added option from box.
{% for option in collection.sort_options %} {% unless option.value contains 'title-ascending' or option.value contains 'title-descending' %} <option value="{{ option.value }}"{% if sort_by == option.value %} selected="selected"{% endif %}>{{ option.name }}</option> {% endunless %} {% endfor %}
So here they remove 'Alphabetically, A-Z' and Alphabetically, Z-A option.
You have to add condition in below line more if you want to hide option
{% unless option.value contains 'title-ascending' or option.value contains 'title-descending' %}
You can use following option in condition:
1. manual
2. best-selling
3. title-ascending
4. title-descending
5. price-ascending
6. price-descending
7. created-ascending
8. created-descending
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024