My products have 2 variants, size and color. I want to display the size options as a series of buttons. Here's my current code:
{% for variant in product.variants %}
<input type="button" name="{{ variant.id }}" id="{{ variant.id }}" value="{{ variant.title }}">
{% endfor %}
This returns buttons with values like S/White, M/White, L/White, etc. I want just S, M and L. Pulling from of the example code in the docs, I've tried
{% for variant in product.variants.size %}
and
{% for variant in product.variants.first %}
but evidently that's not the right syntax as nothing is output.
What's the correct way to do this?
TIA - Joe