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). Use the date filter to return the date in the required format. You can read more about the date filter here. The delivery date field will need to be included in the shopping basket form.


order.products

Returns an array of the products contained in the order, detailed here.


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.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.


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.


order.reward_points.earned

Returns the number of reward points earned with the order.


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