Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello there
I found that the Shopify filter orders the size of the product not by S, M, L, XL...
If you see the image below, it starts from 2XL, 3XL, 4XL...
Does anybody know how to change this? I downloaded some filter apps and those are showing the same problem.
Seems like some coding is needed but I'm not a developer.
To resolve this issue, you may need to adjust the variant order for each product in your Shopify store. To do this, you can follow these steps:
By adjusting the order of the product variants, you should be able to ensure that the size options are displayed in the correct order on your website.
If this does not resolve the issue, you may need to seek assistance from Shopify customer support.
I hope this helps!
<select>
element or an <input>
field with a dropdown.{{ variant.option1 }}
, {{ variant.option2 }}
, or similar.
{% assign size_value = 0 %}
{% case variant.option1 %}
{% when 'S' %}
{% assign size_value = 1 %}
{% when 'M' %}
{% assign size_value = 2 %}
{% when 'L' %}
{% assign size_value = 3 %}
{% when 'XL' %}
{% assign size_value = 4 %}
{% else %}
{% assign size_value = 99 %}
{% endcase %}
size_value
variable in the option value, like this:
<option value="{{ size_value }}">{{ variant.option1 }}</option>
Thank you for your answer @NomtechSolution
I tried it but it is not working. Can you tell me what is wrong? And when I searched variant.option1,
product.gf_quickview.liquid was the only file that has that element not the product-template.liquid.
File name: product.gf_quickview.liquid
Thank you for your answer @NomtechSolution
I tried it but it is not working. Can you tell me what is wrong? And when I searched variant.option1,
product.gf_quickview.liquid was the only file that has that element not the product-template.liquid.
File name: product.gf_quickview.liquid
Thank you for your answer @NomtechSolution
I tried it but it is not working. Can you tell me what is wrong? And when I searched variant.option1,
product.gf_quickview.liquid was the only file that has that element not the product-template.liquid.
File name: product.gf_quickview.liquid
<select name="id" id="gfqv-select">
{% for variant in product.variants %}
<option data-option1="{{variant.option1 | escape}}" data-option2="{{variant.option2 | escape}}" data-option3="{{variant.option3 | escape}}" data-price="{{variant.price}}" data-compare_at_price="{{variant.compare_at_price}}" data-available="{{variant.available}}" data-image-index="{% if variant.image %}{{variant.image.position}}{% endif %}" {% if variant == product.selected_or_first_available_variant %} selected="selected" {% endif %} value="{{ variant.id }}">{{ variant.title }}</option>
{% assign size_value = 0 %}
{% case variant.option1 %}
{% when 'S' %}
{% assign size_value = 1 %}
{% when 'M' %}
{% assign size_value = 2 %}
{% when 'L' %}
{% assign size_value = 3 %}
{% when 'XL' %}
{% assign size_value = 4 %}
{% when '2XL' %}
{% assign size_value = 5 %}
{% when '3XL' %}
{% assign size_value = 6 %}
{% when '4XL' %}
{% assign size_value = 7 %}
{% when '5XL' %}
{% assign size_value = 8 %}
{% else %}
{% assign size_value = 99 %}
{% endcase %}
<option value="{{ size_value }}">{{ variant.option1 }}</option>
{% endfor %}
</select>
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025