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.
On this page
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_amountvariable 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.
| Notification | Section | Insertion instructions |
|---|---|---|
| Order confirmation | Order processing | Shared totals |
| Ready for local pickup | Local pick up | Shared totals |
| Picked up by customer | Local pick up | Shared totals |
| Order invoice | Order exceptions | Invoice totals |
| Order edited | Order exceptions | Shared totals |
| Order canceled | Order exceptions | Shared totals |
| Order refund | Order exceptions | Refund totals |
| Pending payment success | Payments | Shared totals |
| POS abandoned checkout | Point of Sale | Shared totals |
| POS and mobile receipt | Point of Sale | Shared 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:
From your Shopify admin, go to Settings > Notifications.
Click Customer notifications.
In the section listed in the table, click the notification name.
Click Edit code.
Copy the entire Email subject and Email body (HTML) into a separate backup document. Back up any translated versions that you plan to edit.
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:
- In Email body (HTML), search for
<table class="row subtotal-table subtotal-table--total">. - 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. - 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. - 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:
- In Email body (HTML), search for
{% if total_price > total_outstanding %}. - Within that condition, identify the
Already paidrow containing{{ net_payment | money }}. This row followsUpdated totaland is in the table beforeAmount to pay. - Paste the code after the complete
Already paidrow's closing</tr>tag and before that table's closing</table>tag. Keep it inside thetotal_price > total_outstandingcondition. - 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:
- In Email body (HTML), search for
<table class="row subtotal-table subtotal-table--total">. - Identify the end of that table: the final
{% endif %}closes the condition that selects payment terms,Total paid, orTotal. The table's closing</table>tag is followed by{% if total_discounts > 0 %}and a<p class="total-discount">tag. - 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. - 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:
- Click Preview to review your unsaved changes.
- 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
Waivedrow displays the expected amount in the order's currency. For an example without a waived amount, confirm that noWaivedrow is displayed. - 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.
- Close the preview and click Save after checking the template.
- 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:
From your Shopify admin, go to Settings > Notifications.
Click Customer notifications, and then open the relevant template as described in Open and back up a template.
Click Revert to, and then select Default.
Review the default preview and click Save.