Top

Cancellation Management - Add Liquid Code for Cancellation Email Template

If you choose to use the Cancellation Management in Recurring Orders feature and cancellation discount codes, there is a snippet of code you should insert into the “Order confirmation” email Shopify sends out to your customers. 

This snippet of code will stack two coupon codes on top of each other, follow these instructions to insert it:

  1. From “Shopify Admin”, select Settings.

    Step1.png 

  2. Select Notifications.

    Step2.png 

  3. Select Order confirmation.

    Step3.png 

  4. Find this section of code:
    {% 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>
    {% endif %}
  5. Copy this snippet of code and paste it right above the {% endif %}.
    <!-- 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 -->

    It should look like this when you're done:

    {% 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 %}
  6. Select Save.

    Step4.png 

That’s it!

More information on this feature:

Have more questions? Submit a request