Updating email notifications for waived amounts

If you waive balances on orders, then you can display the waived amount in customer emails. The waived amount explains the difference between the order total and the amount paid. You can update customized email templates from Settings > Notifications in your Shopify admin.

Unchanged default templates don't need manual changes. Customized templates that already display the correct waived amount don't need another row. If you don't need a template's customizations, then you can restore the default template instead of editing code.

Considerations for displaying waived amounts in email notifications

Before editing your templates, review the following considerations:

  • These instructions add a display row, not a payment or a discount. Keep your existing total, payment, refund, balance due, and cash rounding calculations. Don't subtract the waived amount from those values again.
  • The code uses the total_waived_amount variable and displays a row only when its value is greater than 0. Searching for the variable alone doesn't confirm that a template displays it correctly.
  • The insertion points match templates based on the English defaults. Keep your custom content, styles, and translated labels. Review any notification translations separately.
  • The Japanese templates for Order canceled, Order refund, and POS and mobile receipt use different table markup, with the waived row after the 合計 row and the label 免除. Don't apply the English insertion points to a different layout.
  • If your template doesn't match an insertion point, then ask the developer who customized it to add the row to your totals table. Don't guess which closing </table> tag to use.

Open and back up a template

The following notifications include the total waived amount in their default email templates. The row is labeled Waived and is displayed only when the order has a waived amount greater than 0. The section and notification names match Settings > Notifications > Customer notifications in your Shopify admin.

Review each template in the table. Only edit customized templates that are missing a correctly displayed waived amount. These instructions apply to email, not SMS or printed receipts.

Notifications with waived amounts in their default email templates, grouped by section on the Customer notifications page.
NotificationSectionInsertion instructions
Order confirmationOrder processingShared totals
Ready for local pickupLocal pick upShared totals
Picked up by customerLocal pick upShared totals
Order invoiceOrder exceptionsInvoice totals
Order editedOrder exceptionsShared totals
Order canceledOrder exceptionsShared totals
Order refundOrder exceptionsRefund totals
Pending payment successPaymentsShared totals
POS abandoned checkoutPoint of SaleShared totals
POS and mobile receiptPoint of SaleShared totals

If your admin displays In-store receipts instead of POS and mobile receipt, then open In-store receipts, select Email as the channel, and select Order confirmation as the receipt type. POS abandoned checkout is a separate notification.

Steps:

  1. From your Shopify admin, go to Settings > Notifications.

  2. Click Customer notifications.

  3. In the section listed in the table, click the notification name.

  4. Click Edit code.

  5. Copy the entire Email subject and Email body (HTML) into a separate backup document. Back up any translated versions that you plan to edit.

  6. Search the body for total_waived_amount. If a row already displays the correct waived amount, then keep it and preview and check the template. Otherwise, use the insertion instructions linked for that template.

Add the row to shared totals

Use these steps for the templates marked Shared totals. This includes the Shopify POS email templates listed in the table. Insert the code without replacing any existing rows.

Copy the following code:

{% if total_waived_amount > 0 %}
  <tbody class="subtotal-line__value-small">
    <tr class="subtotal-line">
      <td class="subtotal-line__title">
        <p><span>Waived</span></p>
      </td>
      <td class="subtotal-line__value">
        <strong>{% if buyer_email_rtl == true %}<span dir="auto" style="display: inline-block; unicode-bidi: isolate; font-size: inherit;">{% endif %}{{ total_waived_amount | money_with_currency }}{% if buyer_email_rtl == true %}</span>{% endif %}</strong>
      </td>
    </tr>
  </tbody>
{% endif %}

Steps:

  1. In Email body (HTML), search for <table class="row subtotal-table subtotal-table--total">.
  2. Identify the closing </table> tag for that table. After it, the transaction breakdown starts with {% unless payment_terms %}, followed by {% if transaction_size > 1 or transaction_amount < total_price %}. Don't use the earlier table containing subtotal, shipping, and taxes, or a later transaction table.
  3. Paste the code immediately before that closing </table> tag, after the final {% endif %} in the totals table. Keep the new row outside the existing payment terms and payment status conditions, and outside transaction loops.
  4. Preview and check the template before saving.

Add the row to invoice totals

The Order invoice template uses the money filter for the waived row, rather than money_with_currency. Keep the existing Amount to pay row and its calculation unchanged.

Copy the following code:

{% if total_waived_amount > 0 %}
  <tr class="subtotal-line">
    <td class="subtotal-line__title">
      <p><span>Waived</span></p>
    </td>
    <td class="subtotal-line__value">
      <strong>{% if buyer_email_rtl == true %}<span dir="auto" style="display: inline-block; unicode-bidi: isolate; font-size: inherit;">{% endif %}{{ total_waived_amount | money }}{% if buyer_email_rtl == true %}</span>{% endif %}</strong>
    </td>
  </tr>
{% endif %}

Steps:

  1. In Email body (HTML), search for {% if total_price > total_outstanding %}.
  2. Within that condition, identify the Already paid row containing {{ net_payment | money }}. This row follows Updated total and is in the table before Amount to pay.
  3. Paste the code after the complete Already paid row's closing </tr> tag and before that table's closing </table> tag. Keep it inside the total_price > total_outstanding condition.
  4. Preview and check the template before saving.

Add the row to refund totals

The Order refund template has a separate totals layout that supports exchanges. Insert the waived row in the totals table, not in the list of refund transactions.

Copy the following code:

{% if total_waived_amount > 0 %}
  <tbody class="subtotal-line__value-small">
    <tr class="subtotal-line">
      <td class="subtotal-line__title">
        <p><span>Waived</span></p>
      </td>
      <td class="subtotal-line__value">
        <strong>{% if buyer_email_rtl == true %}<span dir="auto" style="display: inline-block; unicode-bidi: isolate; font-size: inherit;">{% endif %}{{ total_waived_amount | money_with_currency }}{% if buyer_email_rtl == true %}</span>{% endif %}</strong>
      </td>
    </tr>
  </tbody>
{% endif %}

Steps:

  1. In Email body (HTML), search for <table class="row subtotal-table subtotal-table--total">.
  2. Identify the end of that table: the final {% endif %} closes the condition that selects payment terms, Total paid, or Total. The table's closing </table> tag is followed by {% if total_discounts > 0 %} and a <p class="total-discount"> tag.
  3. Paste the code between that final {% endif %} and closing </table> tag. Keep it outside the existing conditions and transaction loops. Don't replace the discount paragraph or refund calculations.
  4. Preview and check the template before saving.

Preview and save the template

A preview or test email without a waived amount greater than 0 won't display the new row. This alone doesn't mean the code is incorrect. Check an example with a waived amount greater than 0 and one without it. If the editor's sample data doesn't include a waived amount, then ask your developer to test both cases before relying on the template. Don't waive a real customer's balance just to test an email.

Steps:

  1. Click Preview to review your unsaved changes.
  2. Confirm that the order totals, styling, and translated text remain correct. For an example with a waived amount greater than 0, confirm that exactly 1 Waived row displays the expected amount in the order's currency. For an example without a waived amount, confirm that no Waived row is displayed.
  3. Optional: Click Send test email to review the email layout. The test email is sent to the account that you used to log in to the Shopify admin.
  4. Close the preview and click Save after checking the template.
  5. Repeat for each customized template that needs an update, including its customized translations.

Restore the default instead of editing code

You can replace a customized template with the current default instead of adding the row manually.

Steps:

  1. From your Shopify admin, go to Settings > Notifications.

  2. Click Customer notifications, and then open the relevant template as described in Open and back up a template.

  3. Click Revert to, and then select Default.

  4. Review the default preview and click Save.