Ecommerce for Statamic

Order items

Loops through the items in an order and allows you to filter with conditions.

{{ bison:order_details }}

Parameters

order
Specify the URL of the order.
Required. Also available as url.
conditions
Allows you to perform basic filtering.
Field and value should be separated by a colon : and you can specify multiple conditions by pipe | delimiting them. eg. conditions="url:/products/my-product|size:large"

Variables

title
The title of your product’s entry.
url
URL of the product’s entry.
quantity
How many had been purchased.
price
Price of the item with any price modifiers applied.
subtotal
The line total. (price x quantity)
entry
This gives you access to any of the product entry’s fields. You could access a field named sku by using entry.sku.
item_option
If the purchased product had a product modifier applied, this will return the name of it.
item_option_modifier
If the purchased product had a product modifier applied, this will return the price modifier dollar value.
product_price
This will return the base price of the product.
index
The iteration of the product in the cart.
zero_index
The zero-based index.
first
Returns true if it is the first item.
last
Returns true if it is the last item.
total_results
Total items in the order.
Customer data

You can output any of the standard customer data fields captured at or before checkout.

  • {{ first_name }}
  • {{ last_name }}
  • {{ email }}
  • {{ billing_address }}
  • {{ billing_address2 }}
  • {{ billing_city }}
  • {{ billing_state }}
  • {{ billing_zip }}
  • {{ billing_country }}
  • {{ shipping_first_name }}
  • {{ shipping_last_name }}
  • {{ shipping_address }}
  • {{ shipping_address2 }}
  • {{ shipping_city }}
  • {{ shipping_state }}
  • {{ shipping_zip }}
  • {{ shipping_country }}

Example

This will output all the items of a specific order that is for a specific product url.

{{ bison:order_items order="{ url }" conditions="url:/products/my-product" }}
    <li>{{ quantity }} x {{ title }} at {{ price }}/each = {{ subtotal }}</li>
{{ /bison:order_items }}


Problem with this page? Edit it on Github.