In a theme's Liquid templates you access the order object through customer.orders.
Money attributes such as prices and totals are returned in the customer's local (presentment) currency. Use a money filter to show the result as a money amount.
The order object has the following attributes:
order.attributes
Returns the custom cart attributes of the order, if there are any. You can add as many custom attributes to your cart as you need.
When you loop through the attributes, use {{ attribute | first }} for the name of the attribute and {{ attribute | last }} for its value.
{% if order.attributes %}
<p>Order notes:</p>
<ul>
{% for attribute in order.attributes %}
<li><strong>{{ attribute | first }}</strong>: {{ attribute | last }}</li>
{% endfor %}
</ul>
{% endif %}
<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 the order is cancelled, false otherwise.
order.cancelled_at
Returns the timestamp of when the order was cancelled. Use the date filter to format it.
order.cancel_reason
Returns one of these cancellation reasons if the order was cancelled:
- items unavailable
- fraudulent order
- customer changed/cancelled order
- other
order.cancelreasonlabel
Returns the translated output of the order's cancel_reason.
English: {{ order.cancel_reason }}
French: {{ order.cancel_reason_label }}
English: Items unavailable
French: Produits indisponibles
order.cartleveldiscount_applications
Returns an array of order-level discount applications for an order.
{% for discount_application in order.cart_level_discount_applications %}
Discount code: {{ discount_application.title }}
Savings: -{{ discount_application.total_allocated_amount | money }}
{% endfor %}
Discount code: SUMMER16
Savings: -€20.00
order.created_at
Returns the timestamp of when the order was created. Use the date filter to format it.
order.customer
Returns the customer of the order.
order.customer_url
Returns a unique URL the customer can use to access the order.
{{ order.name | link_to: order.customer_url }}
<a href="https://example-shop.versacommerce.de/account/orders/d94ec4a1956f423dc4907167c9ef0413">#1025</a>
order.discount_applications
Returns an array of discount applications for an order.
{% for discount_application in order.discount_applications %}
Discount code: {{ discount_application.title }}
Savings: -{{ discount_application.total_allocated_amount | money }}
{% endfor %}
Discount code: SUMMER16
Savings: -€20.00
order.email
Returns the email address of the order, if it exists.
order.financial_status
Returns the financial status of an order. Possible values:
pendingauthorizedpaidpartially_paidrefundedpartially_refundedvoided
order.financialstatuslabel
Returns the translated output of the order's financial_status.
English: {{ order.financial_status }}
Spanish: {{ order.financial_status_label }}
English: paid
Spanish: Pagado
order.fulfillment_status
Returns the fulfillment status of an order.
order.fulfillmentstatuslabel
Returns the translated output of the order's fulfillment_status.
English: {{ order.fulfillment_status }}
Spanish: {{ order.fulfillment_status_label }}
English: unfulfilled
Spanish: No confirmado
order.line_items
Returns an array of the order's line items.
order.lineitemssubtotal_price
Returns the sum of the order's line item prices after all line item discounts. The subtotal does not include cart discounts, taxes (unless taxes are included in the prices) or shipping costs.
<!-- subtotal = total value of cart items - line item discounts -->
Subtotal: {{ order.line_items_subtotal_price | money }}
<!-- for a cart containing a €500 product with a €50 line item discount -->
Subtotal: €450.00
For a subtotal that includes all types of discounts, see order.subtotal_price.
order.location
(POS only) Returns the physical location of the order. Locations are configured in the location settings of the shop admin.
order.name
Returns the name of the order in the format set in the general settings of the shop admin.
{{ order.name }}
#1025
order.note
Returns the note of a customer order.
To show an order note in an email notification or an order printer template, use {{ note }}. To show it in a template file such as customers/account.liquid, use {{ order.note }}.
Special instructions: {{ order.note }}
Special instructions: Please deliver after 5 pm
order.order_number
Returns the integer representation of the order name.
{{ order.order_number }}
1025
order.orderstatusurl
Returns the unique URL of the order status page of the order.
order.payment_terms
Returns the payment_terms object attached to the order.
order.phone
Returns the phone number of the order, if it exists.
order.shipping_address
Returns the shipping address of the order.
order.shipping_methods
Returns an array of shipping_method variables of the order.
order.shipping_price
Returns the shipping price of an order.
order.subtotallineitems
Returns an array of the line items used to calculate the subtotal price of an order. Tip line items are excluded.
order.subtotal_price
Returns the subtotal price of all items in the order after line item and cart discounts. The subtotal does not include taxes (unless taxes are included in the prices), shipping costs or tips.
For a subtotal that only includes line item discounts, see order.line_items_subtotal_price.
order.tags
Returns an array of all tags of the order. The tags are returned in alphabetical order.
{% for tag in order.tags %}
{{ tag }}
{% endfor %}
leather
new
sale
special
order.tax_lines
Returns an array of tax_line variables for an order.
{% for tax_line in order.tax_lines %}
Tax ({{ tax_line.title }} {{ tax_line.rate | times: 100 }}%): {{ tax_line.price | money }}
{% endfor %}
Tax (VAT 19.0%): €25
order.tax_price
Returns the tax amount of the order.
order.total_discounts
Returns the total value of all discounts applied to the order.
order.totalnetamount
Returns the net amount of the order.
order.total_net_amount is calculated after refunds. It equals order.total_price minus order.total_refunded_amount.
order.total_price
Returns the total price of an order.
order.total_price is calculated before refunds. For the refunded value, use order.total_refunded_amount.
order.totalrefundedamount
Returns the total refunded amount of an order.
order.transactions
Returns an array of transactions of the order.
More properties
VersaCommerce also provides these properties on the order object:
| Properties | Returns |
|---|---|
code, ordered_at, currency, source, item_count, invoice_id, confirmation_number, metafields, pickup_in_store?, cart_attributes, tax_rate, reduced_tax_rate, tax_amount, tax_of_shipping, coupon_value, payment_type, payment_cost, shipping_cost, extra_price, item_total, shipping_type, total, order_total, customer_order_url |
Order metadata, pricing, pickup state and aliases |