# バリエーションのプルダウンメニューに在庫切れの場合は打ち消し線を入れたい

**URL:** <https://community.shopify.com/t/topic/37956>\
**Category:** 技術的なQ＆A\
**Created:** [March 2, 2021, 3:29am UTC](https://community.shopify.com/t/topic/37956 "2021-03-02T03:29:52Z")\
**Posts on this page:** 3\
**Page:** 1

## AI-generated summary

商品のバリエーション選択時に、在庫切れの項目へ打ち消し線や「sold out」表示を付け、選択前の段階で在庫状況を分かるようにしたい、という相談です。

回答では、実装にはLiquid（Shopifyのテンプレート言語）の修正知識が関わる可能性があり、知識がない場合はShopify Partnerへの依頼が現実的だと案内されています。

あわせて、簡易的な方法として、JavaScriptでバリエーション用のselectタグを特定し、ページ表示時にonchangeやonclickなどのイベントを発火させて表示を更新する案も示されました。

ただし、具体的なコード例や確定した実装手順までは提示されておらず、議論は解決済みではなく、実装方法の詳細が未整理のままです。

<div class="post-metadata">

**Author:** ![rotdoto](https://avatars.discourse-cdn.com/v4/letter/r/f08c70/32.png) [@rotdoto](https://community.shopify.com/u/rotdoto)\
**Post date:** [March 2, 2021, 3:29am UTC](https://community.shopify.com/t/topic/37956/1 "2021-03-02T03:29:52Z")

</div>

商品のバリエーションを選択しないと、在庫切れか否かわからないので、  
選択する時点でわかるよう、在庫切れのバリエーションに打消し線（もしくは「sold out」表記など）を入れたいです。  
ご教示いただければと思います。

---

<div class="post-metadata">

**Author:** ![Anonymous\_44fbe07fc59d9ccaacd70575fd5a5155](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/anonymous_44fbe07fc59d9ccaacd70575fd5a5155/32/194200_2.png) [@Anonymous\_44fbe07fc59d9ccaacd70575fd5a5155](https://community.shopify.com/u/Anonymous_44fbe07fc59d9ccaacd70575fd5a5155)\
**Post date:** [March 2, 2021, 4:23pm UTC](https://community.shopify.com/t/topic/37956/2 "2021-03-02T16:23:26Z")

</div>

Liquid修正の基礎知識はお持ちでしょうか？

お持ちでない場合、Shopify Partnerに依頼をされるのが良いかと思います。

---

<div class="post-metadata">

**Author:** ![junichiokamura](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/junichiokamura/32/299737_2.png) [@junichiokamura](https://community.shopify.com/u/junichiokamura)\
**Post date:** [March 9, 2021, 10:30am UTC](https://community.shopify.com/t/topic/37956/3 "2021-03-09T10:30:57Z")

</div>

少しJavaScripthがわかる方であれば、一番簡単な方法としては、バリエーション選択のselectタグをブラウザのコンソールなどで突き止めて、ページの表示時にその要素のonchangeやonclickなどのイベントを発火させると表示が変わると思います。
