Including Rental Dates in your Shopify Order Confirmation Emails
Make sure customers can see the dates they booked in their confirmation
A customer's rental dates come through on an order as line item properties. By default, Shopify does not include line item properties in it's Order Confirmation email template.
To modify the template, go to Shopify Settings > Notifications > Customer Notifications > Order confirmation, then click Edit Code at the top right.
Based on the current default template, we recommend including the line item properties between the selling_plan_allocation and refunded_quantity liquid code for each line item.
The code of the email template is quite complex and outputs slightly different formats for different types of products, so there will usually be multiple parts of the template that need new code added.
The existing code blocks to look for are outlined below. You may find these appear a few times each in your template.
Code Block 1
Look for the following code, or similar. We recommend doing a search through the template code for selling_plan_allocation.
{% if line.selling_plan_allocation %}
<span class="order-list__item-variant">{{ line.selling_plan_allocation.selling_plan.name }}</span><br/>
{% endif %}
{% if line.refunded_quantity > 0 %}
<span class="order-list__item-refunded">Refunded</span>
{% endif %}Each time you see this code, insert the following code between the selling_plan_allocation if statement and the refunded_quantity if statements (the blank line in the middle of the code above), to output line item properties of the item. This excludes 'hidden' properties that start with an underscore.
{% for p in line.properties %}
{% unless p.last == blank or p.first contains '_' %}
<p><strong>{{ p.first }}:</strong> {{ p.last }}</p>
{% endunless %}
{% endfor %}The final result at each code block will look something like this:
Code Block 2
Look for the following code, or similar. We recommend doing a search through the template code for {{component.variant.title}}
Each time you see this code, insert the following code between the component.variant.title if statement and the line_item_group.deliverable if statements (the blank line in the middle of the code above), to output line item properties of the item. This excludes 'hidden' properties that start with an underscore.
The final result at each code block will look similar to this:
Code Block 3
This one usually won't be necessary, but we'll include it anyway, just in case the above aren't working. Look for this in your template:
Add this on a new line directly after it:
Depending on when your store started, and whether previous changes have been made to your order confirmation template, the example code blocks to look for above may or may not be present. In this instance you will need to find the appropriate place(s) to put the code above into your template.
Last updated