Include total discount on "new order" email notification

I’m working to edit the internal “new order” notification email that is sent from Shopify when an order is placed. Beneath the subtotal line I need to include a line displaying the total savings applied to the order.

I’ve reviewed Shopify’s guidelines on Liquid variables found here: https://help.shopify.com/en/manual/orders/notifications/email-variables#discounts and found that the discount_application.total_allocated_amount variable should accomplish what I’m needing. However when adding it in a table row, the “Discounts” title is displayed but the value is not (see screenshot below)

Current code is below:

<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      <span>Discounts</span>
    </p>
  </td>
  <td class="subtotal-line__value">
    <strong>{{ discount_application.total_allocated_amount | money }}</strong>
  </td>
</tr>

Any ideas on what I might be missing?

Hello @JMSarten

Thank you for reaching out to the Shopify community.

To display the total savings applied on the order you can use the liquid variable “discounts_savings”. You can use discounts_amount or discounts_savings based on your requirements. Here is a quick reference link as well for you that explains the usage of both:https://help.shopify.com/en/manual/orders/notifications/email-variables#discounts:~:text=discounts_amount,The%20amount%20of%20the%20savings%20caused%20by%20all%20discounts.

Also, here is the rectified code which can be used directly to show total order discounts in new order notification templates:

<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      <span>Discounts</span>
    </p>
  </td>
  <td class="subtotal-line__value">
    <strong>{{ discounts_amount | money }}</strong>
  </td>
</tr>

Please have a check and let me know if this was helpful.

Thanks.

Thank you for your insights! Using this updated code does at least display a result in the righthand column, however it doesn’t seem to be calculating the savings properly. In this example there should be a $5 discount but both discount_amount and discount_savings display $0. Any idea why that might be happening?

Hey @JMSarten ,

The order that you are referring to has a line time discount or a discount added via a discount code?

Never mind, the solution you provided works just fine! For some reason the discount line was not calculating properly in Shopify’s email previewer. but work perfectly when in use with real orders. Thank you!