Shopify themes, liquid, logos, and UX
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi,
I want to add a new option value from the Sort By dropdown. Then field is a custom metafield in Products named: custom.product_class. The values of this are: Premium and Regular.
First step, I thought of adding the values first on the dropdown from en.default.schema.json.
And also here on main-list-collections.liquid. But still it won't appear. I even tried editing the text of some existing options from the en.default.schema.json but it also wont appear.
Is there way to do this? If you have other ideas?
Thank you.
Hello @aih_kimg ,
Find this part of code, using DAWN it's in sections -> main-collection-product-grid.liquid
{%- for option in collection.sort_options -%}
<option
value="{{ option.value | escape }}"
{% if option.value == sort_by %}
selected="selected"
{% endif %}
>
{{ option.name | escape }}
</option>
{%- endfor -%}
And update it with this one
{%- for option in collection.sort_options -%}
<option
value="{{ option.value | escape }}"
{% if option.value == sort_by %}
selected="selected"
{% endif %}
>
{{ option.name | escape }}
</option>
{%- endfor -%}
<option value="Premium">
Premium
</option>
<option value="Regular">
Regular
</option>
Regards
Guleria
@aih_kimg adding arbitrary html doesn't create a sort algorithm.
Generally apps are need to add a custom sort to a storefront.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org