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

shipping_method オブジェクト

注文の配送方法に関する情報を保持するオブジェクト。配送方法名、金額、税金、割引内容にアクセスできる。

用途
チェックアウトページや注文確認画面で、顧客が選択した配送方法の名前・料金・税金を表示するとき。
設置場所
Liquid テンプレート内で `{{ checkout.shipping_method.title }}` または `{{ order.shipping_method.price_with_discounts | money }}` のようにプロパティを参照する。チェックアウトコンテキストか注文コンテキストかで親オブジェクトが異なる点に注意。
注意点
`price` プロパティは廃止予定で、注文レベル割引を含まない。代わりに `price_with_discounts` を使用する。金額は通貨の最小単位で出力されるため(例:日本円なら10000で100円)、表示時は `| money` フィルターで整形する。タイトルはチェックアウトコンテキストでは顧客の優先言語で、注文コンテキストではチェックアウト時の言語で返されることに注意。
タグ:shippingcheckoutordermoneytax-line

仕様

158 行 / json
{
  "access": {
    "global": false,
    "parents": [
      {
        "object": "checkout",
        "property": "shipping_method"
      },
      {
        "object": "order",
        "property": "shipping_method"
      }
    ],
    "template": []
  },
  "deprecated": false,
  "deprecation_reason": "",
  "description": "",
  "properties": [
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "In most contexts, the shipping method title appears in the customer's preferred language. However, in the context of an\n[order](/docs/api/liquid/objects/order), the shipping method title appears in the language that the customer checked out in.",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The title of the shipping method.",
      "name": "title"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "The value is output in the customer's local (presentment) currency.\n\nFor currencies without subunits, such as JPY and KRW, tenths and hundredths of a unit are appended. For example, 1000 Japanese yen is output as 100000.\n\n> Tip:\n> Use [money filters](/docs/api/liquid/filters/money-filters) to output a formatted price.",
      "examples": [],
      "return_type": [
        {
          "type": "number",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The price of the shipping method in the currency's subunit, before discounts have been applied.",
      "name": "original_price"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "The value is output in the customer's local (presentment) currency.\n\nFor currencies without subunits, such as JPY and KRW, tenths and hundredths of a unit are appended. For example, 1000 Japanese yen is output as 100000.\n\n> Tip:\n> Use [money filters](/docs/api/liquid/filters/money-filters) to output a formatted price.",
      "examples": [],
      "return_type": [
        {
          "type": "number",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The price of the shipping method in the currency's subunit, after discounts have been applied, including order level discounts.",
      "name": "price_with_discounts"
    },
    {
      "deprecated": true,
      "deprecation_reason": "Deprecated because the price did not include order level discounts.\n\nThe `shipping_line.price` property has been replaced by [`shipping_line.price_with_discounts`](/docs/api/liquid/objects/shipping_method#shipping_method-price_with_discounts).",
      "description": "The value is output in the customer's local (presentment) currency.\n\nFor currencies without subunits, such as JPY and KRW, tenths and hundredths of a unit are appended. For example, 1000 Japanese yen is output as 100000.\n\n> Tip:\n> Use [money filters](/docs/api/liquid/filters/money-filters) to output a formatted price.",
      "examples": [],
      "return_type": [
        {
          "type": "number",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The price of the shipping method in the currency's subunit, after discounts have been applied.",
      "name": "price"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "> Note:\n> The price of the shipping method is appended to handle.",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The [handle](/docs/api/liquid/basics#handles) of the shipping method.",
      "name": "handle"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "string",
          "name": "",
          "description": "",
          "array_value": ""
        }
      ],
      "summary": "The ID of the shipping method.",
      "name": "id"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "array",
          "name": "",
          "description": "",
          "array_value": "tax_line"
        }
      ],
      "summary": "The tax lines for the shipping method.",
      "name": "tax_lines"
    },
    {
      "deprecated": false,
      "deprecation_reason": "",
      "description": "",
      "examples": [],
      "return_type": [
        {
          "type": "array",
          "name": "",
          "description": "",
          "array_value": "discount_allocation"
        }
      ],
      "summary": "The discount allocations that apply to the shipping method.",
      "name": "discount_allocations"
    }
  ],
  "summary": "Information about the shipping method for an order.",
  "name": "shipping_method",
  "examples": [],
  "json_data": {
    "path": "/",
    "handle": "customer.orders[1].shipping_method",
    "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