Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello all, I've looked at many different articles about adding size variants/swatches to featured collections and tried some code but to no avail. I'm using refresh theme. Do I need to add something to card-product.liquid? Would love some help! Coding knowledge is slim to none. I only have 3 different sizes for each product and they dont have different images, but they do have different prices. How can I achieve this?
Thank you!
@flavourbombs hey, thanks for posting here.
{% if product.available %}
<select name="id" id="ProductSelect-{{ section.id }}" class="product-single__variants">
{% for variant in product.variants %}
{% if variant.available %}
<option {% if variant == product.selected_or_first_available_variant %} selected="selected" {% endif %}
value="{{ variant.id }}">{{ variant.title }}</option>
{% else %}
<option disabled="disabled">
{{ variant.title }} - {{ 'products.product.sold_out' | t }}
</option>
{% endif %}
{% endfor %}
</select>
{% endif %}
Where exactly would I paste this code sorry?
I've tried pasting it into the product card but nothing happened unfortunately. I need a little more guidance! I'd basically like it to look like this so you can select the size right on the homepage:
@flavourbombs in this image, the variant picker already working/.....
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025