order - aareano/ifshop-wiki GitHub Wiki

This drop corresponds to Shopify's.

additional properties

  • order.discounts_amount
  • order.discounts_savings
  • order.fulfillment_event
  • order.fulfillment
  • order.fulfillments
  • order.id
  • order.item_count
  • order.order_status_url
  • order.refund
  • order.refunds
  • order.requires_shipping
  • order.shipping_method
  • order.shop
  • order.source_name
  • order.transaction

missing properties

none

The following properties are available in Shopify's email templates, but are not (yet) available in ifshop's email templates.

  • order.order_name
  • order.total_tax
  • order.attributes
  • order.referring_site
  • order.landing_site
  • order.landing_site_ref
  • order.has_high_risks
  • order.unique_gateways


order.attributes

Returns the custom cart attributes for the order, or an empty list if there aren't any.

When you're looping through attributes, use any of the following access patterns to get the name of the attribute:

  • {{ attribute.name }}
  • {{ attribute | first }}

Use any of the following access patterns to get the value of the attribute:

  • {{ attribute.value }}
  • {{ attribute | last }}
  • {{ attribute.Name-Of-Attribute }}
  • {{ attribute["Name-Of-Attribute"] }}

Input

{% if order.attributes %}
  <p>Order notes:</p>
  <ul>
    {% for attribute in order.attributes %}
      <li><strong>{{ attribute | first }}</strong>: {{ attribute | last }}</li>
    {% endfor %}
  </ul>
{% endif %}

Output

<p>Order notes:</p>
<ul>
  <li><strong>Message</strong>: I love your products! Thanks!</li>
</ul>

order.billing_address

Returns the billing address of the order.


order.cancelled

Returns true if an order is canceled, or false if it is not.


order.cancelled_at

Returns the timestamp of when an order was canceled. Use the date filter to format the timestamp.


order.cancel_reason

Returns one of the following cancellation reasons, if an order was canceled:

  • items unavailable
  • fraudulent order
  • customer changed/cancelled order
  • other

order.cancel_reason_label

Returns the translated output of an order's order.cancel_reason.

Input

English: {{ order.cancel_reason }}
French: {{ order.cancel_reason_label }}

Output

English: Items unavailable
French: Produits indisponibles

order.created_at

Returns the timestamp of when an order was created. Use the date filter to format the timestamp.


order.customer

Returns the customer associated with the order.


order.customer_url

Returns the URL of the customer's account page.

Input

{{ order.name | link_to: order.customer_url }}

Output

<a href="http://johns-apparel.myshopify.com/account/orders/d94ec4a1956f423dc4907167c9ef0413">#1235</a>

order.discounts

Returns an array of discounts for an order.

Input

{% for discount in order.discounts %}
  Code: {{ discount.code }}
  Savings: {{ discount.savings | money }}
{% endfor %}

Output

Code: SUMMER16
Savings: -$20.00

order.discounts_amount

The total amount of the discounts to be applied to the price of the order. Use one of the money filters to return the value in a monetary format.

Input

{{ discount.discounts_amount | money }}

Output

$25

order.discounts_savings

The total savings from the discounts to be applied to the price of the order.

Input

{{ discount.discounts_savings | money }}

Output

$-25

order.email

Returns the email address associated with an order.


order.financial_status

Returns the financial status of an order. The possible values are:

  • pending
  • authorized
  • paid
  • partially_paid
  • refunded
  • partially_refunded
  • voided

order.financial_status_label

Returns the translated output of an order's financial_status.

Input

English: {{ order.financial_status }}
French: {{ order.financial_status_label }}

Output

English: Paid
French: Payée

order.fulfillment

Defined only for the following events, and in the following ways:

  • a fulfillment event is created
    • Returns the fulfillment for which the event occurred.
  • a fulfillment event is deleted
    • Returns the fulfillment for which the event occurred.
  • a fulfillment is created
    • Returns the fulfillment in question
  • a fulfillment is updated
    • Returns the fulfillment in question

order.fulfillments

Returns an array of the fulfillments for the order.


order.fulfillment_event

Defined only for the following events:

  • a fulfillment event is created
  • a fulfillment event is deleted

Returns the fulfillment event.


order.fulfillment_status

Returns the fulfillment status of an order.


order.fulfillment_status_label

Returns the translated output of an order's fulfillment_status.

Input

English: {{ order.fulfillment_status }}
French: {{ order.fulfillment_status_label }}

Output

English: Unfulfilled
French: Non confirmée

order.id

Returns the id of the order. This is used for Shopify's API purposes.


order.item_count

Returns the cumulative total count of all line items in the order.


order.line_items

Returns an array of line items for the order.


order.location

(POS only) Returns the physical location of the order. You can configure locations in the Locations settings of your Shopify admin.


order.name

Returns the name of the order in the format set in the Standards and formats section of the General settings of your Shopify admin.

Input

{{ order.name }}

Output

#1025

order.note

Returns the note associated with a customer order.

Input

Special instructions: {{ order.note }}

Output

Special instructions: Please deliver after 5 PM

order.order_status_url

Returns the URL pointing to the order status web page. The URL will be null unless the order was created from a checkout.


order.refund

Defined for the following events:

  • a refund is created

Returns a refund drop.


order.refunds

Returns the array of refund drops belonging to the order.


order.order_number

Returns the integer representation of the order name.

Input

{{ order.order_number }}

Output

1025

order.requires_shipping

Returns true if any line item in the order requires shipping, else false.


order.shipping_address

Returns the shipping address of the order.


order.shipping_method

Returns the first element of order.shipping_methods, or nil if order.shipping_methods is nil.


order.shipping_methods

Returns an array of shipping_method variables from the order.


order.shipping_price

Returns the shipping price of an order. Use a money filter to show the result as a monetary amount.


order.shop

Defined for the following events:

  • a fulfillment event is created
  • a fulfillment event is deleted
  • a fulfillment is created
  • a fulfillment is updated
  • a refund is created
  • an order is cancelled
  • an order is created
  • an order is deleted
  • an order is fulfilled
  • an order is paid
  • an order is partially fulfilled
  • an order is updated
  • an order transaction is created

Returns the shop drop.


order.source_name

Returns the name of here the order originated. Orders created through official Shopify channel have possible values of

  • "web"
  • "pos"
  • "iphone"
  • "android"

Orders created via the API may be assigned any other string, with the default of "api".


order.subtotal_price

Returns the subtotal price of an order. Use a money filter to show the result as a monetary amount.


order.tags

Returns an array of all of the order's tags. The tags are returned in no particular order.

Input

{% for tag in order.tags %}
    {{ tag }}
{% endfor %}

Output

sale
leather
special
new

order.tax_lines

Returns an array of tax_line variables for an order.

Input

{% for tax_line in order.tax_lines %}
  Tax ({{ tax_line.title }} {{ tax_line.rate | times: 100 }}%): {{ tax_line.price | money }}
{% endfor %}

Output

Tax (GST 14.0%): $25

order.tax_price

Returns the order's tax price. Use a money filter to show the result as a monetary amount.


order.total_price

Returns the total price of an order. Use a money filter to show the result as a monetary amount.


order.transaction

Defined only for the following event:

  • an order transaction is created

Returns the transaction.


order.transactions

Returns an array of transactions from the order.

⚠️ **GitHub.com Fallback** ⚠️