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

**URL:** <https://community.shopify.com/t/topic/33079>\
**Category:** 技術的なQ＆A\
**Created:** [January 24, 2021, 7:33am UTC](https://community.shopify.com/t/topic/33079 "2021-01-24T07:33:09Z")\
**Posts on this page:** 2\
**Page:** 1

## AI-generated summary

商品ページのバリエーション選択を、現在のプルダウン（`<select>`）からラジオボタンに変更したいという相談。対象として `product-template.liquid` 内の `product.variants` をループしている箇所が示され、オプション数が少ないためラジオボタン表示のほうが適しているのではないか、という背景が共有されている。

現時点で出た具体的な対応は1件で、参考情報として外部ブログ記事へのリンクが提示された。内容は Shopify の商品バリエーション表示をラジオボタン化する実装例と思われるが、スレッド内ではコード修正手順の詳細説明や動作確認結果までは示されていない。

結論として、議論は未解決のまま。次のアクションは、提示された参考記事をもとに `select` 部分をラジオボタン用のマークアップと連携処理に置き換え、実際にテーマ上で検証することになる。

<div class="post-metadata">

**Author:** ![tonkuki](https://avatars.discourse-cdn.com/v4/letter/t/f14d63/32.png) [@tonkuki](https://community.shopify.com/u/tonkuki)\
**Post date:** [January 24, 2021, 7:33am UTC](https://community.shopify.com/t/topic/33079/1 "2021-01-24T07:33:09Z")

</div>

お世話になります。

早速質問です。

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

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

{% for variant in product.variants %} {% if variant.available %} {{ variant.title }} - {{ variant.price | money\_with\_currency }} {% else %} {{ variant.title }} - {{ 'products.product.sold\_out' | t }} {% endif %} {% endfor %}

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

---

<div class="post-metadata">

**Author:** ![Anonymous\_4d9e7ed625bfa1bbc1782320693c1e6d](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/anonymous_4d9e7ed625bfa1bbc1782320693c1e6d/32/312468_2.png) [@Anonymous\_4d9e7ed625bfa1bbc1782320693c1e6d](https://community.shopify.com/u/Anonymous_4d9e7ed625bfa1bbc1782320693c1e6d)\
**Post date:** [January 26, 2021, 4:00am UTC](https://community.shopify.com/t/topic/33079/2 "2021-01-26T04:00:42Z")

</div>

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

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