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/.....
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024