QUANTM7 Docs

Order

The order object for confirmation pages, email templates, and customer account history.

The order object represents a completed purchase. It is available on the order confirmation page, in email notification templates, and inside customer.orders when a customer is logged in.

<h1>Order {{ order.name }}</h1>
<p>Placed on {{ order.created_at | date: '%d %B %Y' }}</p>

Properties

PropertyTypeDescription
order.idstringThe unique order ID
order.namestringThe display name (e.g. #1042)
order.emailstringThe email address on the order
order.created_atdateWhen the order was placed
order.cancelledbooleanWhether the order has been cancelled
order.cancelled_atdateWhen it was cancelled (nil if not cancelled)
order.cancel_reasonstringThe reason given for cancellation

Financial properties

PropertyTypeDescription
order.total_pricenumberThe final total including tax and shipping
order.subtotal_pricenumberTotal before tax and shipping
order.total_taxnumberTotal tax amount
order.total_discountsnumberTotal discount amount
order.shipping_pricenumberShipping cost
order.currencystringThree-letter currency code

All prices are in the smallest currency unit. Use the money filter to display them:

<p>Subtotal: {{ order.subtotal_price | money }}</p>
<p>Shipping: {{ order.shipping_price | money }}</p>
<p>Tax: {{ order.total_tax | money }}</p>
<p>Total: {{ order.total_price | money }}</p>

Line items

The order.line_items array contains every product in the order:

PropertyTypeDescription
item.titlestringProduct title
item.variant_titlestringVariant title (e.g. "Large / Black")
item.skustringSKU code
item.quantitynumberNumber of units ordered
item.pricenumberUnit price
item.line_pricenumberPrice times quantity
item.imageimageProduct image
item.urlstringLink to the product page
{% for item in order.line_items %}
  <div class="order-item">
    {% if item.image %}
      <img src="{{ item.image | img_url: '100x100' }}" alt="{{ item.title }}" />
    {% endif %}
    <div>
      <p>{{ item.title }}</p>
      {% if item.variant_title %}
        <p class="variant">{{ item.variant_title }}</p>
      {% endif %}
      <p>{{ item.quantity }} x {{ item.price | money }}</p>
    </div>
  </div>
{% endfor %}

Addresses

PropertyTypeDescription
order.shipping_addressaddressWhere the order is being shipped
order.billing_addressaddressThe billing address

Each address has the same fields as the customer address object: first_name, last_name, address1, address2, city, province, zip, country, and phone.

<h3>Ship to</h3>
<p>
  {{ order.shipping_address.first_name }} {{ order.shipping_address.last_name }}<br />
  {{ order.shipping_address.address1 }}<br />
  {{ order.shipping_address.city }}, {{ order.shipping_address.zip }}<br />
  {{ order.shipping_address.country }}
</p>

Fulfilment

PropertyTypeDescription
order.fulfillment_statusstringCurrent status: unfulfilled, partial, fulfilled
order.financial_statusstringPayment status: pending, paid, refunded, partially_refunded
{% case order.fulfillment_status %}
  {% when 'fulfilled' %}
    <span class="badge badge--success">Shipped</span>
  {% when 'partial' %}
    <span class="badge badge--warning">Partially Shipped</span>
  {% else %}
    <span class="badge">Processing</span>
{% endcase %}

Discounts

PropertyTypeDescription
order.discount_codesarrayDiscount codes applied to the order
{% for discount in order.discount_codes %}
  <p>Discount: {{ discount.code }} ({{ discount.amount | money }} off)</p>
{% endfor %}

Note

PropertyTypeDescription
order.notestringCustomer note left at checkout
{% if order.note != blank %}
  <div class="order-note">
    <h4>Customer Note</h4>
    <p>{{ order.note }}</p>
  </div>
{% endif %}

On this page