FROM CACHE - jp_header
このコミュニティはピアツーピアサポートに移行しました。Shopify サポートは今後、このコミュニティへのサービスを提供いたしません。これからもぜひ、他のマーチャントやパートナーとつながり、サポートし合い、経験を共有してください。 当社の行動規範に違反する行動や削除を希望するコンテンツがありましたら、引き続きご報告ください

商品のバリエーションをラジオボタンにしたい

商品のバリエーションをラジオボタンにしたい

tonkuki
訪問者
1 0 0

お世話になります。

 

早速質問です。

商品ページのオプションがプルダウンで表示されてるのですが、そこをラジオボタンに変更したいです。
オプションの数が少ないのでラジオボタンのほうが良いかなと。

 

product-template.liquidの下記部分を変更すると思うのですが、どのようにすればいいのでしょうか?

 

<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 %} data-sku="{{ variant.sku }}" value="{{ variant.id }}">{{ variant.title }} - {{ variant.price | money_with_currency }}</option>
{% else %}
<option disabled="disabled">
{{ variant.title }} - {{ 'products.product.sold_out' | t }}
</option>
{% endif %}
{% endfor %}
</select>

 

以上、よろしくお願いします。

1件の返信1

さんつ
Shopify Partner
43 14 53

下記のURLが参考になるかもしれません。一度、お試しください。

http://webmastersjob.blogspot.com/2014/01/radio-buttons-for-product-variations-in.html?m=1