Order
The order object has the following attributes:
order.url
Returns the URL where the order can be viewed in the customer account area on the account order view.
order.reference
Returns the reference of the order.
order.date
Returns the date of the order. Use the date filter to return the date in the required format. You can read more about the date filter here.
order.payment_method
Returns the payment method used to place the order.
order.total
Returns the total value of the order.
order.status
Returns the current status of the order.
order.tracking_url
Returns the tracking URL of the order.
order.comments
Returns the comments associated with the order (as entered when the order was created).
order.delivery_date
Returns the delivery date (if entered). This value is stored as a text string and the date filter cannot be used. The delivery date field will need to be included in the shopping basket form or enabled in platform checkout.
order.pdf_url
Returns the URL for the invoice PDF for the order.
If you have created multiple PDFs to use, the live theme will be returned using the variable above. If you want to include the URL for one of your other PDFs, use the variable order.pdf_url(ID), where ID is replaced with the unique ID of the PDF template, which can be found beside the name of the PDF on the 'Order Invoices' page.
order.products
Returns an array of the products contained in the order, detailed here.
If you would like to sort the order in which products are displayed by either the SKU code, product name, quantity or price use order.products('...') where ... is replaced with one of the following sort values:
skusku_asc
sku_desc
name
name_asc
name_desc
quantity
quantity_asc
quantity_desc
price
price_asc
price_desc
order.customer.id
Returns the ID of the customer that placed the order.
order.customer.is_trade
Returns true if the order was placed by a registered trade customer.
order.customer.is_credit
Only applicable to trade customers, returns true if the customer has been marked as a credit customer.
order.billing_name
Returns the billing name of the order.
order.billing_company
Returns the billing company name of the order.
order.billing_phone
Returns the billing phone number of the order.
order.billing_email
Returns the billing email address of the order.
order.billing_address
Returns the billing address of the order. Use the nl2br filter to insert line breaks.
The following variables can also be used:
order.billing_address1
order.billing_address2
order.billing_address3
order.billing_city
order.billing_province
order.billing_country
order.billing_postcode
order.shipping_name
Returns the shipping name of the order.
order.shipping_company
Returns the shipping company name of the order.
order.shipping_phone
Returns the shipping phone number of the order.
order.shipping_email
Returns the shipping email address of the order.
order.shipping_address
Returns the shipping address of the order. Use the nl2br filter to insert line breaks.
The following variables can also be used:
order.shipping_address1
order.shipping_address2
order.shipping_address3
order.shipping_city
order.shipping_province
order.shipping_country
order.shipping_postcode
order.reward_points.earned
Returns the number of reward points earned with the order.
order.reward_points.balance
Returns the number of reward points in the customer's account after the order was finalised.
order.sub_total
Returns the sub total of the order. The value will be returned excluding any tax/VAT.
If discounts are applied to the order these will be included in this price.
order.original_sub_total
Returns the original sub total (i.e. before any discounts are applied) of the order. The value will be returned excluding any tax/VAT.
Including tax
The order.sub_total and order.original_sub_total variables will return the value excluding any tax/VAT.
Additional variables are available to display the value including any tax/VAT.
order.sub_total_including_vat
order.original_sub_total_including_vat
order.shipping_total
Returns the grand total of shipping charges. The value will be returned excluding any tax/VAT.
If discounts are applied to the order these will be included in this price.
order.original_shipping_total
Returns the original grand total (i.e. before any discounts are applied) of shipping charges. The value will be returned excluding any tax/VAT.
Including tax
The order.shipping_total and order.original_shipping_total variables will return the value excluding any tax/VAT.
Additional variables are available to display the value including any tax/VAT.
order.shipping_total_including_vat
order.original_shipping_total_including_vat
order.shipping_rates
Returns an array of shipping rates for the order, for example
{% for rate in order.shipping_rates %} {{ rate.name }} {{ currency_value(rate.price) }} {% endfor %}
returns...
Fast Delivery £9.95
rate.name returns the name of the shipping rate.
rate.price returns the price of the shipping rate.
order.discount_total
Returns the total discounts earned on the order.
order.payment_gateway_fee
Returns any transaction fee paid by the customer.
order.discounts
Returns an array of discounts received on the order, for example
{% for discount in order.discounts %} {{ discount.name }} ~ {{ currency_value(discount.price) }} {% endfor %}
returns...
TENOFF ~ £10
discount.name returns the name of the discount.
discount.price returns the value of the discount.
order.refunds
Returns an array of refunds added to an order, for example
{% for refund in order.refunds %} {{ refund.name }} ~ {{ format_price(refund.value) }} {% endfor %}
returns...
Returned item ~ £39.95
refund.name returns the comment added for the refund.
refund.value returns the value of the refund.
order.vat
Returns the total VAT amount on the order.
order.sales_tax
Returns the total sales tax amount on the order.
order.partial_payment_total
Returns the total deducted from the order as a result of the use of a gift voucher.
order.total
Returns the grand total of the order.
order.reward_points.converted
Returns the total number of points converted on the order.
order.reward_points.discount
Returns the total value of the discount applied to the order as a result of the use of reward points.
order.partial_payments
Returns an array of partial payments (gift vouchers) applied to the order.
{% for partial_payment in order.partial_payments %} {{ partial_payment.source_type }} ~ {{ partial_payment.data }} ~ {{ partial_payment.amount }} {% endfor %}
returns...
gift_voucher ~ C8XFAGV1TDSL ~ 10.00
partial_payment.source_type returns the type of partial payment.
partial_payment.data returns data associated with the partial payment (e.g. the gift code used).
partial_payment.amount returns the amount of the partial payment.
order.digital_files
Returns an array, if the order contains digital downloads, of the digital files in an order. For use on the account order view.
{% for digital_file in order.digital_files %} {{ digital_file.title }} <br> {{ digital_file.product_id }} <br> {{ digital_file.created_at|date('d/m/Y H:i:s') }} <br> {% if digital_file.expired_at %} {{ digital_file.expired_at|date('d/m/Y H:i:s') }} <br> {% endif %} {{ digital_file.download_limit }} <br> {{ digital_file.downloads }} <br> {{ digital_file.url }} {% endfor %}
returns...
cross_stitch_pattern.pdf 28318392 29/01/2018 29/02/2018 3 1 https://www.yourdomain.com/digital-file_link
digital_file.title returns the name of the digital file.
digital_file.product_id returns the unique platform ID of the product to which the download relates.
digital_file.created_at returns the date the download link was first available (i.e. the order date).
digital_file.expired_at returns the date the download link will expire.
digital_file.download_limit returns the maximum number of times the file can be downloaded.
digital_file.downloads returns the number of times the file has already been downloaded.
digital_file.url returns the URL where the file can be downloaded.
order.admin_comments
Returns an array of admin comments on the order, for example
{% for admin_comment in order.admin_comments %} {{ admin_comment.created|date('d/m/Y') }} ~ {{ admin_comment.content }} {% endfor %}
returns...
30/02/2018 ~ Order refunded by credit card
created returns the date that the order comment was created
content returns the contents of the comment
order.transaction_id
Returns the transaction ID for the order if one was received from the payment gateway.
order.payment_processor_data.card.last_four_digits
Returns the last four digits of the card that was used to make payment for the order.