Shopify Tutorials

Add Available Sizes To My Product Grid On Shopify Store

This modification adds product sizes to the product grid/collection page of your Shopify store.

Editing your theme code to add this feature

  • In the Template directory, create a new file called collection.available-size.liquid and copy the collection.liquid from the same directory.
  • In the Snippets directory, find the product-card-grid.liquid file and add the following code at the specific place where you want to show the sizes, here we’ve added the after the price. Price code looks like this {% include 'product-price', variant: product.selected_or_first_available_variant %} :
{% if collection.template_suffix == "available-size" %}

<p>
{% for option in product.options %}
{% if option == 'Size' %}
{% if product.options_with_values[0].name=="Size" %}
{% for variant in product.variants %}

{{ variant.option1  }}

{% endfor%}
{% elsif product.options_with_values[1].name=="Size" %}
{% for variant in product.variants %}

{{ variant.option2  }}

{% endfor%}
{% else %}
{% for variant in product.variants %}

{{ variant.option3  }}

{% endfor%}
{% endif %}

{% endif %}
{% endfor %}
</p>
{% endif %}
  • In the Theme admin, go to a collection and set the template to collection.available-size, it’ll enable the available sizes in the product grid in the collection page

Congrats you’ve completed this feature

Shopify Developer

Share
Published by
Shopify Developer

Recent Posts

How to Link eBay to Shopify Store

Imagine! Seamlessly connecting the vast customer base of eBay with the robust features of your…

3 weeks ago

Unlock the Power of Shopify Flow: Automation Strategies for eCommerce

Let’s face it. Running an online store requires unwavering discipline. Juggling multiple tasks simultaneously is…

4 weeks ago

Everything You Need to Know About Shopify Liquid

There’s no denying that Shopify has taken over the world. The ecommerce platform contributes to…

1 month ago

Maximizing Revenue: 7 Best Shopify Themes for Conversion Rates that Soar

It’s true. Every marketing strategy has one common objective: to drive maximum conversion rates. If…

2 months ago

Terrific Dropshipping Business Ideas for 2024

*Sigh*. Are you tired of trying out different methods of making money online? Hear it…

2 months ago

Shopify SEO Checklist for Continued Success in 2023

When driving traffic to your Shopify store, Search Engine Optimization (SEO) is the most affordable…

2 months ago