Order Confirmation
Use Workflow and Autoresponder Emails to send confirmation messages to customers, including a detailed breakdown of their Order.
Prerequisites
You have installed eCommerce Module v0.12.0 or later. Checkout Modules Overview to find out how you can install the latest version.
You have set up a Checkout or Quote-only Form. Learn more about Checkout here: How to Set Up a Shopping Cart and Guest Checkout or learn more about the Quote-only feature here: eCommerce - Quote Only
Introduction
You can now add details of a customer's eCommerce Order to Workflow and Autoresponder transactional emails. Give your Client and the customer peace of mind, as well as valuable records for their safekeeping.
eCommerce Orders are created by Checkout and Quote-only Forms.
Within the email, you can also access any fields that were submitted along with the original Form. Learn more here: Dynamic Content in Workflow and Autoresponder Emails
Syntax
Add the following Liquid tag to include the details of the customer's most recent Order: <div data-gb-custom-block data-tag="include" data-0='ecommerce/order_details' data-1='email' data-2='email'></div>
In an email notification, this will always be based on the Form that triggered the email. Only an Order generated by that Form submission will be visible in this context. This means that Autoresponder emails will always show Form Submission data from the correct User.
Layouts
File Structure
You can use an existing Layout, or create a new one in this File Structure: layouts/modules/module_14/order/my_layout/
Within your Layout folder, you'll need:
An
item.liquid
and awrapper.liquid
file
Developing the Layout
Inside your email notification file, you'll have access to the Form object: {{form.properties}}
This contains the fields submitted with the Form. Learn more here:** **Dynamic Content in Workflow and Autoresponder Emails You'll still have access to these fields throughout the Order Details Layouts.
Inside your order_details
layout you'll find an item.liquid
and wrapper.liquid
file.
Wrapper
You can use the wrapper.liquid
file to build the main HTML structure of your Layout. When you're ready to include the Order Details, use the following Liquid to include the item.liquid
file:
Item
The item.liquid
file will have access to the This object, which will contain details about the Order:{{this}}
Orders involve several different types of models and can be complex. When developing you will need to use loops to take into account each different eCommerce element which may be a part of the Order.
When developing a custom layout, it may be helpful to refer to the default Layout.
Looping over Products This loop will find any Products in the Order and loop over them.
*Looping over Products and accessing Fields *Within a Product Loop, you can access the fields associated with that Product.
{{ product.product_name }}
{{ product.quantity }}
{{ product.product_code }}
{{ product.currency_symbol }}
{{ product.price }}
Looping over Products, then looping over Attributes
Outputting Shipping Method The following fields are available relating to the Shipping Method:
this['Shipping Method Name']
this['Currency Symbol']
this['Shipping Method Price']
`
` - a formatted Shipping Price
Example of only including Shipping Information if it was set:
Outputting Totals
{{ this['Currency Symbol'] }}
this['Total Price']
`
` - A formatted total price
Last updated