The order object
You can access the order
object in a theme's Liquid templates with customer.orders
.
The order
object has the following attributes:
order.attributes
Returns the custom cart attributes for the order, if there are any. You can add as many custom attributes to your cart as you like.
When you're looping through attributes, use {{ attribute | first }}
to get the name of the attribute, and {{ attribute | last }}
to get its value.
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 to merchant</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.cart_level_discount_applications
Returns an array of order-specific discount applications for an order.
Input
{% for discount_application in order.cart_level_discount_applications %}
Discount name: {{ discount_application.title }}
Savings: -{{ discount_application.total_allocated_amount | money }}
{% endfor %}
Output
Discount name: SUMMER16
Savings: -$20.00
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 a unique URL that the customer can use to access the order.
Input
{{ order.name | link_to: order.customer_url }}
Output
<a href="http://johns-apparel.myshopify.com/account/orders/d94ec4a1956f423dc4907167c9ef0413">#1235</a>
order.discount_applications
Returns an array of discount applications for an order.
Input
{% for discount_application in order.discount_applications %}
Discount name: {{ discount_application.title }}
Savings: -{{ discount_application.total_allocated_amount | money }}
{% endfor %}
Output
Discount name: SUMMER16
Savings: -$20.00
order.email
Returns the email address associated with an order, if it exists.
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_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.line_items
Returns an array of line items for the order.
order.line_items_subtotal_price
Returns the sum of the order's line-item prices after any line item discounts have been applied. The subtotal amount doesn't include cart discounts, taxes (unless taxes are included in the prices), or shipping costs.
Input
<!-- subtotal = total dollar value of cart items - line item discount -->
Subtotal: {{ order.line_items_subtotal_price | money }}
Output
<!-- for a cart containing a $500 product with a $50 line item discount -->
Subtotal: $450.00
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_number
Returns the integer representation of the order name.
Input
{{ order.order_number }}
Output
1025
order.order_status_url
Returns the unique URL for the order status page of the order.
order.phone
Returns the phone number associated with an order, if it exists.
order.shipping_address
Returns the shipping address of the order.
order.shipping_methods
Returns an array of shipping_method variables from the order.
order.shipping_price
Returns the shipping price of an order.
order.subtotal_line_items
Returns an array of line items that are used to calculate the subtotal_price of an order. Excludes tip line items.
order.subtotal_price
Returns the subtotal price of all the items in the order after both line-item and cart discounts have been applied. The subtotal doesn't include taxes (unless taxes are included in the prices), shipping costs, or tips.
order.tags
Returns an array of all of the order's tags. The tags are returned in alphabetical order.
Input
{% for tag in order.tags %}
{{ tag }}
{% endfor %}
Output
new
leather
sale
special
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.
order.total_discounts
Returns the total value of all discounts applied to the order.
order.total_net_amount
Returns the net amount of the order.
The order.total_net_amount
is calculated after refunds are applied. The value is equivalent to order.total_price
minus order.total_refunded_amount
.
order.total_price
Returns the total price of an order.
The order.total_price
amount is calculated before refunds are applied. To get the value of refunds,
use the order.total_refunded_amount
property.
order.total_refunded_amount
Returns the total refunded amount of an order.
order.transactions
Returns an array of transactions from the order.