Shopify themes, liquid, logos, and UX
Hello guys!
I'm trying to figure out a way to add the available size variants on the collection page, either over the product image or underneath, here are a couple of examples of what I mean:
I've tried adding snippets and codes I've found here in the forum and elsewhere but the solutions are quite limited and when included the size variants are displayed in a wrong alignment or showing all variants including the unavailable ones, here are some examples:
Any light on this issue will be highly appreciated, thank you very much in advance!
Hello @JSVartare ,
You can try to follow these steps:
Go to Online Store -> Themes -> Actions -> Edit code
Go to Section -> collection-template.liquid file or something name similar to this
Find the loop that iterates through the products in the collection like this
{% for product in collection.products %}
<!-- Product HTML markup goes here -->
{% endfor %}
Inside the loop, modify the code like this example
{% for variant in product.variants %}
{% if variant.available %}
<p>{{ variant.title }}</p>
{% endif %}
{% endfor %}
Save and preview
Hope this can help.
Transcy
Thank you very much! I'll test it out and get back here to let you know if it worked.
Hey Transcy!
This worked for me, but it added the variants as a vertical list. Is there a way to make the list horizontal?
Kindest,
Penny
For anyone trying to showcase all product variants and their prices in Shopify collections, here's a video that could help.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025