# 特定のロケーションでの通貨セレクター非表示

**URL:** <https://community.shopify.com/t/topic/295300>\
**Category:** 技術的なQ＆A\
**Tags:** javascript, html\
**Created:** [February 13, 2024, 3:02am UTC](https://community.shopify.com/t/topic/295300 "2024-02-13T03:02:18Z")\
**Posts on this page:** 3\
**Page:** 1

## AI-generated summary

Prestigeテーマを使用しているオンラインストアで、特定のロケーション（アメリカ）からアクセスした場合のみ通貨セレクターを非表示にする方法についての質問。

**質問内容：**
- 通貨セレクターと言語セレクターの表示/非表示はカスタム設定で可能
- アメリカからのアクセス時のみ通貨セレクターを非表示にしたい
- footer.liquidへの追記で実現可能か

**解決策：**
回答者が以下のコードを提案：
- `{%- if show_country_selector or show_locale_selector -%}` の配下に条件分岐を挿入
- アメリカ（ISO国コード 'US'）の場合に `show_country_selector` を `false` に設定するコード

**結果：**
質問者が解決策を実装し、問題が解決された。

<div class="post-metadata">

**Author:** ![akunaj](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@akunaj](https://community.shopify.com/u/akunaj)\
**Post date:** [February 13, 2024, 3:02am UTC](https://community.shopify.com/t/topic/295300/1 "2024-02-13T03:02:18Z")

</div>

質問です。

テーマはPrestigeを使用しています。

通貨セレクターと言語セレクターの表示、非表示はカスタムから行えますが、

特定のロケーション(アメリカ)からオンラインストアを見られた場合のみ通貨セレクターを非表示にできたらと考えております。

 ![スクリーンショット 2024-02-13 11.57.34.png](https://canada1.discourse-cdn.com/shopifyforum/original/3X/e/2/e26d56a9300c80d06cba227bd56abb33898afeb4.png)

footer.liquidに追記したら可能でしょうか？

もし可能でしたら、サンプルコードをお教えいただけますと助かります。

ぜひお知恵をお貸しください。

何卒よろしくお願い致します。

[[セレクター部分のデフォルトのコード]]

{%- if section.settings.show\_locale\_selector and localization.available\_languages.size \> 1 -%}  
{%- assign show\_locale\_selector = true -%}  
{%- endif -%}

{%- if show\_country\_selector or show\_locale\_selector -%}

{%- if show\_country\_selector -%} {%- render 'localization-selector', type: 'country', placement: 'top-start', show\_country\_name: section.settings.show\_country\_name, show\_country\_flag: section.settings.show\_country\_flag -%} {%- endif -%}

{%- if show\_locale\_selector -%}  
{%- render ‘localization-selector’, type: ‘locale’, placement: ‘top-start’ -%}  
{%- endif -%}

{%- endif -%}

© {{ 'now' | date: '%Y' }} - {{ shop.name }}

{%- if section.settings.show\_payment\_icons and shop.enabled\_payment\_types.size \> 0 -%}

{%- for type in shop.enabled\_payment\_types -%} {{- type | payment\_type\_svg\_tag -}} {%- endfor -%}
{%- endif -%}

---

<div class="post-metadata">

**Author:** ![improv](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/improv/32/59666_2.png) [@improv](https://community.shopify.com/u/improv)\
**Post date:** [February 13, 2024, 4:17am UTC](https://community.shopify.com/t/topic/295300/2 "2024-02-13T04:17:24Z")

</div>

初めまして。

４行目の {%- if show\_country\_selector or show\_locale\_selector -%} の配下に下記コードを挿入すれば

実現可能かと思います。

```markup
{%- if localization.country.iso_code == 'US' -%}
  {%- assign show_country_selector = false -%}
{%- endif -%}

```

ご参考までに。

---

<div class="post-metadata">

**Author:** ![akunaj](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@akunaj](https://community.shopify.com/u/akunaj)\
**Post date:** [February 13, 2024, 4:35am UTC](https://community.shopify.com/t/topic/295300/3 "2024-02-13T04:35:54Z")

</div>

ありがとうございます！

助かりました。

実装してみます。
