通知の参照変数

ストアから送信された通知は、Liquidを使用してレンダリングされます。Liquidは、Shopifyの分かりやすくて使いやすいプログラミング言語です。テーマストアのテーマの構築に使用されるものと同じプログラミング言語です。

ストアから送信される通知を編集するために、通知テンプレートの基本カスタマイズを行うことができます。

通知にさらに高度な修正を加える場合、あるいはカスタム通知テンプレートに修正を加える場合は、フォーラムのコミュニティに問い合わせてください。カスタマイズを行うにあたり、Shopify Expertを雇うこともできます。Shopify Expertの採用について詳しくは、こちらをご覧ください。

管理画面から編集できるLiquid通知テンプレートのリストは、以下のとおりです。

  • 買い忘れ
  • お客様に連絡する
  • お客様アカウントの招待
  • お客様アカウントへの挨拶
  • お客様アカウントのパスワード再設定
  • 下書き注文の請求書
  • フルフィルメントのリクエスト
  • ギフトカードの作成
  • 新しい注文
  • 新規注文(モバイル)
  • 注文の請求書
  • キャンセル済のご注文
  • 注文の確認
  • POSとモバイルレシート
  • 注文の返金
  • 配送情報通知
  • 配送状況の更新

管理画面のテンプレートすべてで、対応する注文のプロパティにアクセスできます。

注文プロパティ

多くの注文プロパティは、テンプレートや追加スクリプトで直接Liquidを使用できます。

注文プロパティは、以下のテンプレートで使用できます。

  • 注文の確認
  • 新しい注文
  • 新規注文(モバイル)
  • 注文の請求書
  • 配送情報通知
  • 配送状況の更新
  • 追加スクリプト
  • フルフィルメントのリクエスト
注文プロパティの説明
プロパティ 説明
id

社内で使用するシステム全体の固有の注文ID。以下の例を使用して、ストアの管理画面セクションで注文へのリンクを生成します。たとえば、新しい注文テンプレートでは、以下のコードを追加できます。

<a href="{{ shop.url }}/admin/orders/{{ id }}">注文を見る</a>
email
注文に関連づけられたメール
name

通常はハッシュ記号とそれに続くorder_number

例: #1004

order_name
nameと同様
order_number

注文に含まれるストアの個別番号。これにはハッシュ記号 (#) のプリフィックス、または、ストアの各種設定でストアオーナーが注文IDに追加したプリフィックスまたはサフィックスが含まれない。

例: 1004

created_at

お客様が注文を作成した日時。日付で絞り込んでフォーマットが可能。

例: 2009-05-30T17:43:51+02:00

payment_terms

注文の支払い期日となる日付を、決済期間として明記します。

注文の請求書に決済期間を追加する方法について確認してください。

詳細については、payment_termsに関するLiquidのリファレンスをご覧ください。

tags 注文のタグすべての配列を返す。タグをアルファベット順で返す。詳細については「Liquid参照ドキュメント」を参照。
transactions 注文からの取引の配列を返す。
tax_price
注文のすべてのアイテムに関する税金の総計
tax_lines

以下の税金タイプごとに分類された税金。

{% for tax_line in tax_lines %} {{ tax_line.title }} ({{ tax_line.rate_percentage }}%) : {{ tax_line.price | money_with_currency }} {% endfor %}
tax_line.title

税金の名称。

例: QSTまたはVAT

tax_line.price
税金の金額
tax_line.rate
税率。17.5%の場合は0.175を返す
tax_line.rate_percentage
解読可能な形式での税率。税率が0.175の場合は17.5を返す
customer
お客様出力の属性を含むお客様オブジェクト。
billing_address
請求先住所
billing_address.first_name
お客様の名前
billing_address.last_name
お客様の名字
billing_address.company
請求先の会社名
billing_address.phone
請求先住所の電話番号
shop.name
ストアの名前
shop.phone
ストアの電話番号
subtotal_price
注文にある項目の価格合計 (項目ディスカウントまたはカートディスカウントを差し引いた後の金額)。小計には、税金 (税込価格でない限り)、送料、またはチップが含まれない。
discounts
ディスカウントのリスト
discounts_amount

ディスカウントすべてによって適用されるディスカウント金額。

例: +$5.00

discounts_savings

ディスカウントすべてによって削減できる金額。

例: -5.00ドル

total_price

注文の合計 (小計+送料-配送料ディスカウント+税)

financial_status
現在の決済状況。nil、pendingauthorizedpaidvoidedrefundedのいずれかが表示されます。
requires_shipping
(ブーリアン) 配送を必要とする注文に、少なくとも1つのアイテムがある場合にtrueを返す
shipping_method.title

配送料の名称。

例: 通常配送

shipping_method.price

配送ディスカウントを含む配送価格。

例: {{ shipping_method.price | money }}

shipping_price

配送の価格

例: {{ shipping_price | money }}

shipping_address
配送先住所
shipping_address.first_name
配送先住所で使用される名前
shipping_address.company
配送先住所の会社名
shipping_address.phone
配送先住所の電話番号
line_items
注文の項目すべてのリスト
item_count
すべてのアイテムの個数の合計
fulfillment_status
注文の現在のフルフィルメント状況。unfulfilledpartialfulfilledのいずれかが表示される。
note
注文に添付するメモ。お客様から入手し、管理画面のインターフェイスの注文明細画面で編集可能
attributes

注文に添付する任意の属性

例: {{ attributes.gift-note }}

referring_site

お客様をストアに誘導した参照元のURLを含む

例: https://www.google.com/?s=great+products

landing_site

お客様が使用したランディングサイトのパスを含む。お客様がストアを訪問したときに、最初に閲覧したページ

例: /products/great-product?ref=my-tracking-token

landing_site_ref

ランディングサイトを参照し、そこから参照パラメータを抽出する。参照パラメータは、refsourcerの場合がある

landing_site/products/great-product?ref=my-tracking-tokenの場合、landing_site_refmy-tracking-tokenとなる。refが特定の値と等しい場合、以下の特定の操作を実行できる。

{% if landing_site_ref == 'my-tracking-token' %}My action...{% endif %}
cancelled
(ブーリアン) 注文がキャンセルされた場合はtrueを返す
cancelled_at
注文がキャンセルされた日時
cancel_reason
注文がキャンセルされた理由。inventorycustomerdeclinedfraudotherのいずれかが表示される。
has_high_risks?
(非推奨)

注文のリスクが高い場合は、trueを返す

unique_gateways

注文に関して固有の決済サービスのリストを返す。たとえば、Visa、Mastercard、キャッシュで支払いを行う場合、返されるリストはshopify_payments, cashとなる。

location (POS only)

注文の実際のロケーションを表示する。ここに列挙されている、複数のロケーションプロパティを利用できる。管理画面のロケーションエリアでロケーションを設定できる。

order_status_url

この注文の注文状況ページへのリンクを返す

fulfilled_line_items
(非推奨)
発送済の項目リスト
unfulfilled_line_items
(非推奨)
発送が完了していない項目のリスト。
b2b?

Returns true if the order is a B2B order. Use the property with B2B variables to display relevant information, such as the company name, company location, and address in emails. For example, on B2B orders, you might add a header to a template with the following information:

{% if b2b? %}
        <p> Customer: {{ customer.name }}
        <p> Company: {{ company.name }}
        <p> Location: {{ company_location.name }}
      {endif%}
      
company

The company that you’re selling to on a B2B order.

company.name

The name of the company on a B2B order.

company.id

The ID of the company on a B2B order.

company_location

The location of the company on a B2B order. A company that buys from you can have more than one location.

company_location.name

The name of the company location on a B2B order.

company_location.id

The ID number of the company location on a B2B order.

company_location.shipping_address

The shipping addressof the company location on a B2B order.

company_location.billing_address

The billing addressof the company location on a B2B order.

Draft order properties

Draft order properties are available on the Draft Order Invoice email template, which notifies your customers about outstanding invoices.

Description of draft order properties
Property Description
id
A unique ID of the draft order for internal use.
invoice_url
A link the customer can follow to pay for the invoice using Shopify's secure checkout.
reserve_inventory_until

The date and time the line items in the draft are reserved until, for example, 2015-05-30T17:43:51+02:00.

You can format dates using the Liquid date filter.

user
The last staff who modified the draft order.
user.name
The name of the last staff who modified the draft order.
user.email
The email address of the last staff who modified the draft order.
email
The email address associated with the draft order.
name
The unique number of the draft order, prefixed by a number sign #.
number
The unique number of the draft order without the order prefix or suffix.
created_at

The date and time the customer created the draft order, for example, 2009-05-30T17:43:51+02:00.

You can format dates using the Liquid date filter.

tags Returns an array of all of the order's tags. The tags are returned in alphabetical order. Please see our Liquid reference documentation for more details.
tax_price
The combined taxes of all the items in the draft order.
tax_lines

Taxes broken up by type of tax:

{% for tax_line in tax_lines %}
{{ tax_line.title }} ({{ tax_line.rate_percentage }}%) : {{ tax_line.price | money_with_currency }}
{% endfor %}
tax_line.title

The name of the tax.

Examples: QST or VAT

tax_line.price
The tax amount.
tax_line.rate
The tax rate in decimal form. For example, a tax rate of 17.5% will return 0.175.
tax_line.rate_percentage
The tax rate in percentage form. For example, a rate of 0.175 will return 17.5.
customer
Customer object containing the attributes of the customer output.
billing_address
The billing address for the draft order.
billing_address.first_name
The customer's first name.
billing_address.last_name
The customer's last name.
billing_address.company
The company name in the billing address.
billing_address.phone
The phone number in the billing address.
shop.name
The name of your store.
shop.phone
Your store's phone number.
subtotal_price
Sum of the draft order's line-item prices after any line-item discount or cart discount has been deducted. The subtotal doesn't include taxes (unless taxes are included in the prices) or shipping costs.
discounts
A list of discounts.
discounts_amount

Amount of the discount applied by all discounts.

Example: +$5.00

discounts_savings

Amount of the savings caused by all discounts.

Example: -$5.00

total_price
The total price of the order (subtotal + shipping cost - shipping discount + tax).
requires_shipping
Returns true if there is at least one item in the draft order that requires shipping. Returns false if no items in the draft order require shipping.
shipping_method.title

The Shipping rate name.

Example: Standard Shipping

shipping_method.price
The price of the shipping method. Returns the same information as shipping_price.
shipping_price

The shipping price.

You can format this amount using Liquid money filters.

shipping_address

The shipping address.

Note: Unlike in regular orders, a draft order's shipping address may be incomplete.

shipping_address.first_name
The first name for the shipping address.
shipping_address.company
The company name in the shipping address.
shipping_address.phone
The phone number in the shipping address.
line_items
A list of all line items in the draft order.
item_count
A sum of all the item quantities in the draft order.
note
The note attached to the draft order. The note can be obtained from the customer and also edited in the draft order detail screen in your Shopify admin.
location

The physical location of the order. There are several location properties available.

You can configure locations in the Locations page of your Shopify admin.

b2b?

Returns true if the order is a B2B order. Use the property with B2B variables to display relevant information, such as the company name, company location, and address in emails. For example, on B2B orders, you might add a header to a template with the following information:

{% if b2b? %}
        <p> Customer: {{ customer.name }}
        <p> Company: {{ company.name }}
        <p> Location: {{ company_location.name }}
      {endif%}
      
company

The company that you’re selling to on a B2B order.

company.name

The name of the company on a B2B order.

company.id

The ID of the company on a B2B order.

company_location

The location of the company on a B2B order. A company that buys from you can have more than one location.

company_location.name

The name of the company location on a B2B order.

company_location.id

The ID number of the company location on a B2B order.

company_location.shipping_address

The shipping addressof the company location on a B2B order.

company_location.billing_address

The billing addressof the company location on a B2B order.

Line item properties

Each line in the list of line_items or subtotal_line_items has the following properties.

Description of line item properties
Property Description
line.applied_discounts
(POS and draft orders only)
List of discounts applied to this item (each discount has the title, code, amount, savings and type properties).
line.custom
(Draft orders only)
(boolean) Returns true if the item is a custom line item for a draft order.
line.grams
Weight of a single item.
line.image
Returns the URL of the image associated with this line item. You can also use the img_url filter to get specific image sizes, for example {{ line.image | img_url: 'small' }}
line.line_price
The price multiplied by the quantity for that item.
line.original_line_price
The combined price of the quantity of items included in the line, before discounts were applied.
line.final_line_price
The combined price of all the items in the line item, including all line level discount amounts.
line.price
The price for a single item.
line.product.metafields

The Metafields at the product level. Use the following syntax:

line.product.metafields.NAMESPACE.KEY

line.product.title
The name of the product.
line.product.vendor
The vendor for the item.
line.properties
Returns an array of custom information for an item. Line item properties are specified by the customer on the product page, before adding a product to the cart.
line.quantity
Quantity for that item.
line.requires_shipping
(boolean) Returns true if the variant for the item has the checkbox This is a physical product checked on the product page.
line.selling_plan_allocation
Returns a selling_plan_allocation object, which describes how a selling plan such as a subscription impacts the line item.
line.taxable
(boolean) Returns true if the variant for the item has the checkbox 'Charge taxes on this product' checked on the product page.
line.title
The name of the product followed by a dash followed by the name of the variant. The variant name isn't included when it is “Default Title”.
line.url
The relative URL of the line item's variant. The relative URL doesn't include your store's root URL (mystore.myshopify.com).
line.line_item.variant.barcode
The barcode associated with the product variant.
line.variant.compare_at_price
The compare at price associated with the product variant.
line.variant.image
The image for the product variant. Only returns an image if there is a specific image assigned to the variant in the line item.
line.variant.metafields

The Metafields at the variant level. Use the following syntax:

line.variant.metafields.NAMESPACE.KEY

line.variant.sku
The SKU associated with the product variant.
line.variant.title

The variant's option values, joined by / characters.

Example: small / red

line.refunded.quantity 
      
(within refund notifications)

The quantity of an item to be refunded. You can use this property to add an identifier to refunded items in an order.

For example: {% if line.refunded_quantity > 0 %}Refunded line identifier{% endif %}

Refunds properties

These additional properties are available on the Refunds email template. This email template is used to notify your customers that a refund (complete or partial) has been applied to their order. You can use any variable available for the Order email notification template, in addition to the following variables:

Description of refunds properties
Property Description
amount
The amount of money refunded.
refund_line_items
A list of refund line items to be refunded.

Refund_line_item properties

Each refund_line in the list of refund_line_items has the following properties:

Description of refund line item properties
Property Description
refund_line.line_item
The line_item that is being refunded. This has access to all the line_item’s properties.
refund_line.quantity
The quantity of the line item to be refunded.

Fulfillment properties

These additional properties are available on the Shipping confirmation, Shipping update and Fulfillment request email templates.

The Shipping confirmation and Shipping update are used to notify your customers that some or all items in their order have been successfully fulfilled, or updated with new shipping information.

The Fulfillment request email template is used for any custom fulfillment service defined in your shop admin. To add a custom fulfillment service, go to Settings > Shipping and scroll down to Fulfillment/Dropshipping.

Description of fulfillment properties
Property Description
service_name
The name of the custom service as defined in the Settings > Shipping page. (Fulfillment request only)
fulfillment.estimated_delivery_at
An estimated delivery date based on the tracking number (if available) provided by one of the following carriers: USPS, FedEx, UPS, Canada Post (Canada only). This property is only available when carrier-calculated rates are in use.
fulfillment.fulfillment_line_items
A list of fulfillment line items to be fulfilled.
fulfillment.item_count
A sum of all the items' quantities. The total number of items being fulfilled.
fulfillment.requires_shipping
(boolean) Returns true if this fulfillment request requires shipping.
fulfillment.tracking_company
The company doing the tracking.
fulfillment.tracking_numbers
A list of tracking numbers.
fulfillment.tracking_urls
A list of tracking URLs.
items_to_fulfill
(deprecated)
A list of line items that are to be fulfilled by this particular custom fulfillment service. (Fulfillment request only)
items_to_fulfill_count
(deprecated)
The total number of items to be fulfilled by this request. (Fulfillment request only)

Fulfillment_line_item properties

Each fulfillment_line in the list of fulfillment_line_items has the following properties.

Description of fulfillment line item properties
Property Description
fulfillment_line.line_item
The line_item being fulfilled. This has access to all the line_item's properties.
fulfillment_line.quantity
The quantity of the line item that is being fulfilled.

Delivery properties

Description of delivery properties
Property Description
delivery_instructions
Local delivery information to share with the customer. This information is controlled by the Delivery information field in your local delivery settings.
consolidated_estimated_delivery_time
Order delivery dates information to share with the customer. This information is controlled by the Processing time setting that you set up in your Shipping and delivery page.

Discount properties

There are two types of discount properties.

discount_applications describe why and how an item was discounted.

discount_allocations describe how a particular discount affects a line item and how it reduces the price. You should use this property at the line item level.

You can combine these properties to display discount information at the line item or order level.

Example

This example checks if a discount has been applied to the line item. If the discount wasn't applied at the order level (all), then the discount name and amount are displayed.

{% if line.discount_allocations %}
    {% for discount_allocation in line.discount_allocations %}
        {% if discount_allocation.discount_application.target_selection != 'all' %}
            {{ discount_allocation.discount_application.title | upcase }}
            (-{{ discount_allocation.amount | money }})
        {% endif %}
    {% endfor %}
{% endif %}

The result might look like this:

SPRING5 (-$5.00)

Discount_allocation properties

Each discount_allocation in the list of discount_allocations has the following properties.

Description of discount_allocation properties
Property Description
discount_allocation.amount
The amount of money saved by the customer on a line item. Must be entered in a loop if you want to allow multiple discount codes.
discount_allocation.discount_application
The discount application that allocates the amount on the line item.

Discount_application properties

Each discount_application in the list of discount_applications has the following properties.

Description of discount_application properties
Property Description
discount_application.target_selection

Describes how a discount selects line items in the cart to be discounted. One of:

  • all: The discount applies to all line items.
  • entitled: The discount applies to a particular subset of line items, often defined by a condition.
  • explicit: The discount applies to a specifically selected line item or shipping line.
discount_application.target_type
The type of item that a discount applies to (line_item or shipping_line).
discount_application.title

The customer-facing name of the discount.

Examples: Welcome10 or CBBWQQAKYBYY

discount_application.total_allocated_amount
The total amount that the price of an order is reduced by the discount.
discount_application.type
The type of the discount. One of: automatic, discount_code, manual, or script.
discount_application.value
The value of the discount.
discount_application.value_type
The value type of the discount. One of: fixed_amount or percentage.

Email notification properties

Description of email notification properties
Property Description
shop.email_logo_url
The url for the logo specified in the Customize email templates section of the admin.
shop.email_logo_width
The logo width (pixels) specified in the Customize email templates section of the admin.
shop.email_accent_color
The HEX code for the accent color specified in the Customize email templates section of the admin.

Shopifyで販売を開始する準備はできていますか?

無料体験を試す