I'm creating a Shopify theme in which product options are made of radio buttons rather than dropdown selects. For example, the code for the product color option is:
{% for value in option.values %}
{% assign radio_id = 'option-' | append: option_name | append: '-' | append: value | handleize %}
<input class="variant-radio" id="{{ radio_id }}" type="radio" name="{{ option_name }}" value="{{ value }}" {% if value == selected %}checked{% endif %}>
<label for="{{ radio_id }}">
{{ value }}
</label>
{% endfor %}
How do I make the first option as the default selected color? If I remove the {% if value == selected %} and {% endif %} around checked, it only sets the last option as selected by default.