Liquid Snippets by ALSEL
📘 公式リファレンス📦 リファレンス/オブジェクト初級

address オブジェクト

顧客の住所情報を格納するオブジェクト。姓名、住所行、都市、郵便番号、国などのプロパティを持ち、チェックアウト、顧客プロフィール、注文の送受信先アドレスから参照される。

用途
顧客の配送先住所や請求先住所を表示したい場合、または注文画面で住所情報を取得する際に使用する。
設置場所
Liquid テンプレート内で `{{ customer.addresses[0].first_name }}` や `{{ order.shipping_address.city }}` のように参照し、プロパティにアクセスする。
注意点
company と phone、address2 は指定されない場合に nil を返すため、出力前に `if` タグで存在確認する必要がある。住所を国別フォーマットで表示する場合は `format_address` フィルターを併用するとよい。customer アドレスの url プロパティは顧客住所にのみ適用されるため、注文やチェックアウトアドレスでは使えない。
タグ:addresscustomerordercheckoutlocation

仕様

326 行 / json
{
  "access": {
    "global": false,
    "parents": [
      {
        "object": "checkout",
        "property": "billing_address"
      },
      {
        "object": "checkout",
        "property": "shipping_address"
      },
      {
        "object": "customer",
        "property": "addresses"
      },
      {
        "object": "customer",
        "property": "default_address"
      },
      {
        "object": "location",
        "property": "address"
      },
      {
        "object": "order",
        "property": "billing_address"
      },
      {
        "object": "order",
        "property": "shipping_address"
      },
      {
        "object": "shop",
        "property": "address"
      }
    ],
    "template": []
  },
  "deprecated": false,
  "deprecation_reason": "",
  "description": "> Tip:\n> Use the [`format_address` filter](/docs/api/liquid/filters/format_address) to output an address according to its locale.",
  "properties": [
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "If no company is specified, then `nil` is returned.",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The company of the address.",
      "name": "company"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "If no phone number is specified, then `nil` is returned.",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The phone number of the address.",
      "name": "phone"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The first name of the address.",
      "name": "first_name"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The last name of the address.",
      "name": "last_name"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "A combination of the first and last names of the address.",
      "name": "name"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "> Note:\n> This only applies to customer addresses.",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The relative URL for the address.",
      "name": "url"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "A summary of the address, including the following properties:\n\n- First and last name\n- First and second lines\n- City\n- Province\n- Country",
      "name": "summary"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "number",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The ID of the address.",
      "name": "id"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The first line of the address.",
      "name": "address1"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "If no second line is specified, then `nil` is returned.",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The second line of the address.",
      "name": "address2"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The city of the address.",
      "name": "city"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The zip or postal code of the address.",
      "name": "zip"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The country of the address in [ISO 3166-1 (alpha 2) format](https://www.iso.org/glossary-for-iso-3166.html).",
      "name": "country_code"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "> Note:\n> The value doesn't include the preceding [ISO 3166-1](https://www.iso.org/glossary-for-iso-3166.html) country code.",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The province of the address in [ISO 3166-2 (alpha 2) format](https://www.iso.org/glossary-for-iso-3166.html).",
      "name": "province_code"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "country",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The country of the address.",
      "name": "country"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "A combination of the first and second lines of the address.",
      "name": "street"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The province of the address.",
      "name": "province"
    }
  ],
  "summary": "An address, such as a customer address or order shipping address.",
  "name": "address",
  "examples": [],
  "json_data": {
    "path": "/",
    "handle": "shop.address",
    "data_from_file": ""
  },
  "return_type": []
}

出典・ライセンス

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