Top

Cancellation Management - Add Liquid Code for Cancellation Email Template

If you choose to use cancellation discount codes, and the Cancellation Management feature, which you can read about here - be aware there is a snippet of code you should insert into a Shopify email that sends out to your customers.

We are giving you the ability to 'stack' two coupons codes on top of one another, so for this to be illustrated in their order confirmation email effectively, this is a necessary edit.

This snippet needs to be inserted into this email:

Shopify Admin > Settings > Notifications > Order confirmation.

Right click on the image below to 'open image in new tab', to see the image larger.

 

In this email, you must insert this snippet of code. A simple copy and paste should do the trick. ;) We would recommend somewhere at the bottom of the email.

 

The Code Snippet:


 <!-- BEGIN: CANCELLATION DISCOUNT --> 

{% if attributes.cancellation-coupon-code and discounts.first.code != attributes.cancellation-coupon-code %}
<tr class="subtotal-line">
<td class="subtotal-line__title">
<p>
<span>Cancellation Discount ({{ attributes.cancellation-coupon-code }})</span>
</p>
</td>
<td class="subtotal-line__value">
<strong>{{ attributes.cancellation-coupon-amount }}</strong>
</td>
</tr>
{% endif %}
<!-- END: CANCELLATION DISCOUNT -->

 

Placement of Snippet:


You need to place the snippet after you see this:

{% if discounts.first.code %}

<tr class="subtotal-line">
 <td class="subtotal-line__title">
   <p>
     <span>Discount ({{ discounts.first.code }})</span>
   </p>
 </td>
 <td class="subtotal-line__value">
   <strong>{{ discounts_savings | money }}</strong>
 </td>
</tr>

And before you see this:

{% endif %}


The Final Result:


Our code is in the blue, and the code you need to insert it somewhere between is in red.

{% if discounts.first.code %}

<tr class="subtotal-line">
<td class="subtotal-line__title">
<p>
<span>Discount ({{ discounts.first.code }})</span>
</p>
</td>
<td class="subtotal-line__value">
<strong>{{ discounts_savings | money }}</strong>
</td>
</tr>

<!-- BEGIN: CANCELLATION DISCOUNT -->
{% if attributes.cancellation-coupon-code and discounts.first.code != attributes.cancellation-coupon-code %}
<tr class="subtotal-line">
<td class="subtotal-line__title">
<p>
<span>Cancellation Discount ({{ attributes.cancellation-coupon-code }})</span>
</p>
</td>
<td class="subtotal-line__value">
<strong>{{ attributes.cancellation-coupon-amount }}</strong>
</td>
</tr>
{% endif %}
<!-- END: CANCELLATION DISCOUNT -->

{% endif %}

 

 

Have more questions? Submit a request