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 to look for will look something like the code below. You may find this appears a few times in your template. 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 %}

Last updated