Order Loop

Order loop displays orders information.

{loop type="order" name="the-loop-name" [argument="value"], [...]}

Important informations :

* : argument is required
** : at least one of ** marked argument is required

Global arguments

Argument Description
backend_context

Determine if loop is use in backend context.

default : false

example : backend_context="on"

force_return

force return result for i18n tables even if there is no record

default : false

example : force_return="on"

limit

The maximum number of results to display.

example : limit="10"

name *

The loop name. This name must be unique and is used to reference this loop further in the page (see ifloop, elseloop or pageloop)

offset

The first product to display offset. Will not be used if `page` argument is set.

default : 0

example : offset="1"

page

The page to display.

example : page="2"

Text search arguments
Argument Description
search_in

A comma separeted list of field in which the search is performed

Possible values : ref, invoice_ref, customer_ref, customer_firstname, customer_lastname, customer_email, delivery_ref (since 2.3), transaction_ref (since 2.3)

example : search_in="title"

search_mode

the search mode : `any_word` (search any word separeted by a space), `sentence` (the sentence, anywhere in the field) or `strict_sentence` (the exact sentence)

default : strict_sentence

search_term

The term to search

example : search_term="my product"

Loop arguments

Argument Description
customer

A single customer id or `current` keyword to get logged in user or `*` keyword to match all users.

default : current

example : customer="2", customer="current"

exclude_status (2.2+)

A single or a list of order status ID which are to be excluded from the results

example : status="*", exclude_status="1,4,7"

exclude_status_code (2.2+)

A single or a list of order status codes which are to be excluded from the results. The valid status codes are not_paid, paid, processing, sent, canceled, or any custom status that may be defined

example : exclude_status_code="paid,processing"

id

A single or a list of order ids.

example : id="2", id="1,4,7"

order

A list of values

Expected values :
  • company : company order
  • company-reverse : reverse company order
  • create-date : creation date order
  • create-date-reverse : reverse creation date order
  • customer-name : customer name order
  • customer-name-reverse : reverse customer name order
  • id : id order
  • id-reverse : reverse id order
  • reference : reference order
  • reference-reverse : reverse reference order
  • status : status order
  • status-reverse : reverse status order

default : create-date-reverse

example : order="reference-reverse"

status

A single or a list of order status ID or `*` keyword to match all

example : status="*", status="1,4,7"

status_code (2.2+)

A single or a list of order status codes or `*` keyword to match all. The valid status codes are not_paid, paid, processing, sent, canceled, or any custom status that may be defined

example : status="*", status="not_paid,canceled"

with_prev_next_info
Thelia >= 2.3

A boolean. If set to true, $PREVIOUS and $NEXT output arguments are available.

default : false

example : with_prev_next_info="yes"

Global outputs

Variable Description
$LOOP_COUNT the current results index, starting from 1
$LOOP_TOTAL the total number of results returned by the loop
$CREATE_DATE The creation date of this Order
$UPDATE_DATE The last modification date of this Order

Loop outputs

Variable Description
$CURRENCY the order currency id ; you can use it in a currency loop
$CURRENCY_RATE the order currency rate
$CUSTOMER the order customer id ; you can use it in a customer loop
$DELIVERY_ADDRESS the order delivery address id ; you can use it in a order address loop
$DELIVERY_MODULE the order delivery module id ; you can use it in a module loop
$DELIVERY_REF the order delivery reference. It's usually use for tracking package
$DISCOUNT the order discount
$HAS_NEXT >= 2.3 true if a order exists after this one, following orders id. Only available if with_prev_next_info parameter is set to true
$HAS_PAID_STATUS True is the order has the 'paid' status, false otherwise
$HAS_PREVIOUS >= 2.3 true if a order exists before this one following orders id. Only available if with_prev_next_info parameter is set to true
$ID the order id
$INVOICE_ADDRESS the order the order invoice address id ; you can use it in a order address loop
$INVOICE_REF the order invoice reference
$IS_CANCELED True is the order has the 'canceled' status, false otherwise
$IS_NOT_PAID True is the order has the 'not paid' status, false otherwise
$IS_PAID True is the order has been paid (whatever current status is), false otherwise
$IS_PROCESSING True is the order has the 'processing' status, false otherwise
$IS_SENT True is the order has the 'sent' status, false otherwise
$LANG the order language id
$NEXT >= 2.3 The ID of order after this one, following orders id, or null if none exists. Only available if with_prev_next_info parameter is set to true
$PAYMENT_MODULE the order payment module id ; you can use it in a module loop
$POSTAGE the order postage
$POSTAGE_TAX the order postage tax (2.2+)
$POSTAGE_TAX_RULE_TITLE the tax rule used to get the postage tax amount (2.2+)
$POSTAGE_UNTAXED the order postage amount without tax (2.2+)
$PREVIOUS >= 2.3 The ID of order before this one, following orders id, or null if none exists. Only available if with_prev_next_info parameter is set to true
$REF the order reference
$STATUS the order status ; you can use it in a order status loop
$STATUS_CODE the order status code (2.2)
$TOTAL_AMOUNT the order amount without taxes
$TOTAL_TAX the order taxes amount
$TOTAL_TAXED_AMOUNT the order amount including taxes
$TRANSACTION_REF the order transaction reference. It's usually the unique identifier shared between the e-shop and it's bank
$VIRTUAL the order has at least one product which is a virtual product
$WEIGHT The total weight of the order (2.2+)