Ecommerce for Statamic

Order details

Outputs details about the order just placed.

{{ bison:order_details }}

Tag pairs

items
Loops through the order items.

Variables

order_id
The unique order ID hash. This is part of the filename and is what you’d use to reference the order in your payment gateway.
title
The title of your order. This would be something like Order #1 where the number is sequential. This is used in the control panel.
subtotal
Outputs the total cost of just the products purchased. (Excluding tax and shipping)
shipping
Outputs the shipping cost.
tax
Outputs the tax cost.
total
Outputs the total order cost. Includes items, taxes, shipping.
quantity
How many had been purchased.
Available inside the items tag pair.
price
Price of the item with any price modifiers applied.
Available inside the items tag pair.
subtotal
The line total. (price x quantity)
Available inside the items tag pair.
entry
This gives you access to any of the product entry’s fields. You could access a field named sku by using entry.sku.
Available inside the items tag pair.
item_option
If the purchased product had a product modifier applied, this will return the name of it.
Available inside the items tag pair.
item_option_modifier
If the purchased product had a product modifier applied, this will return the price modifier dollar value.
Available inside the items tag pair.
product_price
This will return the base price of the product.
Available inside the items tag pair.
index
The iteration of the product in the cart.
Available inside the items tag pair.
zero_index
The zero-based index.
Available inside the items tag pair.
first
Returns true if it is the first item.
Available inside the items tag pair.
last
Returns true if it is the last item.
Available inside the items tag pair.
total_results
Total items in the order.
Available inside the items tag pair.
no_results
If the order is empty, this will return true.
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 }}
  • {{ tax_number }}
  • {{ custom_data:field_name }}

Example

{{ bison:order_details }}
  {{ if no_results }}
    <p>You have not placed an order.</p>
  {{ else }}
    <p>Billed to: {{ first_name }}<br />
    Shipping to: {{ shipping_first_name }}</p>
    <p>Items:</p>
    <ul>
      {{ items }}
        <li>{{ quantity }} x {{ title }} at {{ price }}/each = {{ subtotal }}</li>
      {{ /items }}
    </ul>
    <p>Subtotal: {{ subtotal }}<br />
    Shipping: {{ shipping }}<br />
    Tax: {{ tax }}<br />
    Grand Total: {{ total }}</p>
  {{ endif }}
{{ /bison:order_details }}


Problem with this page? Edit it on Github.