Created
June 14, 2018 18:56
-
-
Save curiouscrusher/27f9c47fc103f61e5148015d133cfb91 to your computer and use it in GitHub Desktop.
Swap the select dropdowns for radio input types and retain full Slate compatibility
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% unless product.has_only_default_variant %} | |
{% for option in product.options_with_values %} | |
<div class="selector-wrapper js"> | |
{%- assign i = forloop.index0 -%} | |
<h1> | |
{{ option.name }} | |
</h1> | |
{% for value in option.values %} | |
<input class="" id="SingleOptionSelector-{{ i }}-{{ value | handle }}" data-single-option-selector data-index="option{{ option.position }}" type="radio" name="SingleOptionSelector-{{ i }}" value="{{ value | escape }}"{% if option.selected_value == value %}checked="checked"{% endif %} {% unless current_variant.available %}disabled="disabled"{% endunless %} > | |
<label for="SingleOptionSelector-{{ i }}-{{ value | handle }}"><span>{{ value }}</span></label> | |
{% endfor %} | |
</div> | |
{% endfor %} | |
{% endunless %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment