Size variants on collection page please help!

can someone help me with coding to show the available sizes on the collection page? my Shopify theme is symmetry.

thank you

Hi @AB38

I hope you are doing good and welcome to the Shopify Community!
I am San from MS Web Designer.

You can use this app to add Size Variants on Collection Page:

https://apps.shopify.com/product-size-swatch

Regards,

San

Hi,

Do you mean filter sidebar, where people would choose the size they want & filter the collection?

Do you mean the size swatch on the product or the size filter? If you want both then you can try this app https://apps.shopify.com/ultimate-search-and-filter-1

Thank you for your response. As I mentioned, I want the coding because I don’t want to pay a monthly fee.

no, i want to show on each product the sizes available. In the collection page.

Oh, right.

Then you should use something like this:

{% for value in product.options_by_name.size.values %}
   {{ value }}
{% endfor %}

It will display a list of Size values you have for your product. Now you just have to style it the way you like, be it a dropdown list or small buttons and whatnot.

Sorry, missed the part where you want to display only the available values. In that case you should use this instead:

{% for variant in product.variants %}
   {% if variant.available %}
{{ variant.title }}
 {% endif %}
   {% endfor %}

Again, styling is up to you.