📘 公式リファレンス📦 リファレンス/オブジェクト初級
currency オブジェクト
通貨情報を扱うオブジェクト。ISO コード、シンボル、通貨名を取得できる。
用途
ストアで複数通貨に対応しているとき、カート内や商品ページで現在の通貨をコード・記号・名前で表示したいとき。
設置場所
Liquid テンプレート内で `{{ cart.currency.iso_code }}`、`{{ cart.currency.symbol }}`、`{{ cart.currency.name }}` など、親オブジェクト(cart、money、country など)経由で参照する。
注意点
currency は直接グローバルスコープでアクセスできず、cart.currency や shop.enabled_currencies のように親オブジェクトを通じてのみ参照可能。Shopify Markets で複数通貨を有効にしていることが前提となる。iso_code は ISO 4217 に準拠した 3 文字コード(例: JPY、USD、EUR)である。
仕様
94 行 / json{
"access": {
"global": false,
"parents": [
{
"object": "cart",
"property": "currency"
},
{
"object": "country",
"property": "currency"
},
{
"object": "shop",
"property": "enabled_currencies"
},
{
"object": "money",
"property": "currency"
},
{
"object": "shop",
"property": "money_format"
},
{
"object": "shop",
"property": "money_with_currency_format"
}
],
"template": []
},
"deprecated": false,
"deprecation_reason": "",
"description": "",
"properties": [
{
"deprecated": false,
"deprecation_reason": "",
"description": "",
"examples": [],
"return_type": [
{
"type": "string",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "The [ISO code](https://www.iso.org/iso-4217-currency-codes.html) of the currency.",
"name": "iso_code"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "",
"examples": [],
"return_type": [
{
"type": "string",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "The symbol of the currency.",
"name": "symbol"
},
{
"deprecated": false,
"deprecation_reason": "",
"description": "",
"examples": [],
"return_type": [
{
"type": "string",
"name": "",
"description": "",
"array_value": ""
}
],
"summary": "The name of the currency.",
"name": "name"
}
],
"summary": "Information about a currency, like the ISO code and symbol.",
"name": "currency",
"examples": [],
"json_data": {
"path": "/",
"handle": "localization.country.currency",
"data_from_file": ""
},
"return_type": []
}出典・ライセンス
- Repository:
- https://github.com/Shopify/theme-liquid-docs
- License:
- MIT
このコードは Shopify 著作の MIT ライセンスソースです。 原本の著作権は Shopify が保有します。日本語訳は ALSEL によるものです。
関連項目
📘 公式リファレンス📦 リファレンス/オブジェクト初級
content_for_header オブジェクト
Shopify が必要とするスクリプト(分析・チェックアウト・言語設定など)をすべて動的に出力するオブジェクト。theme.liquid の <head> タグ内に埋め込む必須要素。
📁 theme-liquid-docs·MIT·20 行
📘 公式リファレンス📦 リファレンス/オブジェクト中級
metaobjects オブジェクト
ストア全体のメタオブジェクト定義にアクセスするグローバルオブジェクト。個別のメタオブジェクトはタイプとハンドルで参照でき、メタオブジェクト定義のエントリをループで反復処理できる。
📁 theme-liquid-docs·MIT·20 行
📘 公式リファレンス📦 リファレンス/オブジェクト初級
additional_checkout_buttons オブジェクト
PayPal Express Checkout など、オフサイト決済に対応した外部決済プロバイダーがストアに設定されているかを真偽値で返す。`content_for_additional_checkout_buttons` と組み合わせて、該当するチェックアウトボタンを条件付きで表示する。
📁 theme-liquid-docs·MIT·27 行
📘 公式リファレンス📦 リファレンス/オブジェクト初級
canonical_url オブジェクト
現在のページの正規 URL を取得するオブジェクト。Google などの検索エンジンに対してどのページ版が正規であるかを指定するために使用する。
📁 theme-liquid-docs·MIT·27 行
📘 公式リファレンス📦 リファレンス/オブジェクト初級
content_for_index オブジェクト
ホームページに表示するセクションの内容を動的に返すオブジェクト。Liquid インデックステンプレートで必ず使用する。
📁 theme-liquid-docs·MIT·27 行
📘 公式リファレンス📦 リファレンス/オブジェクト初級
content_for_additional_checkout_buttons オブジェクト
PayPal、Apple Pay、Google Pay など複数の決済プロバイダが有効になっているとき、その決済ボタンを HTML として出力するオブジェクト。`additional_checkout_buttons` で有無を判定したうえで、このオブジェクトで実際のボタンを表示する。
📁 theme-liquid-docs·MIT·27 行