Update the POS exchange V2 receipt email notification for cash rounding
If your store uses customized notification templates, then you might need to update your POS exchange V2 receipt email notification manually to ensure that it displays cash rounding on the receipt.
These changes require familiarity with the code that's used in Shopify's notification templates. If your templates are highly customized and you're not sure how to apply the necessary changes, then contact the developer that made the changes or click Revert to default to restore your template to its original state. When you revert to default, all of your customizations are removed, but the default template ensures that you have the most current template version.
Update the POS exchange V2 receipt email notification
You can update the POS exchange V2 receipt notification to display the net cash rounding amount arising from exchange transactions, along with the rounded exchange total amount in the receipt.
Steps:
From your Shopify admin, go to Settings > Notifications.
Click Customer notifications.
In the Point of Sale section, click POS exchange V2 receipt.
Click Edit code.
Add logic to calculate the net cash rounding amount and add it to the
exchange_total
.- Locate the code block that contains
<span>Exchange total</span>
. - Replace the existing code block with the following code block which computes a
net_exchange_rounding
and adds it to theexchange_total
:
- Locate the code block that contains
<table class="row subtotal-table">
<div class="subtotal-table--total subtotal-table--total-no-border">
<tr class="subtotal-line">
<td class="subtotal-line__title">
<p>
<span>Exchange total</span>
</p>
</td>
<td class="subtotal-line__value">
<strong>{% if exchange_total < 0 %}-{% endif %}{{ exchange_total | abs | money_with_currency }}</strong>
</td>
</tr>
</div>
{% assign net_exchange_rounding = 0 %}
{% for transaction in transactions %}
{% if transaction.status == "success" %}
{% if transaction.kind == "sale" or transaction.kind == "capture" %}
{% if transaction.amount_rounding != nil %}
{% assign net_exchange_rounding = net_exchange_rounding | plus: transaction.amount_rounding %}
{% endif %}
{% elsif transaction.kind == "refund" or transaction.kind == "change" %}
{% if transaction.amount_rounding != nil %}
{% assign net_exchange_rounding = net_exchange_rounding | minus: transaction.amount_rounding %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% if net_exchange_rounding != 0 %}
<table class="row subtotal-table subtotal-table--total">
<div class="subtotal-line__value-small">
<tr class="subtotal-line">
<td class="subtotal-line__title">
<p> <span>Cash rounding</span> </p>
</td>
<td class="subtotal-line__value">
<strong>{% if net_exchange_rounding < 0 %}-{% endif %} {{ net_exchange_rounding | abs | money }}</strong>
</td>
</tr>
</div>
</table>
<table class="row subtotal-table subtotal-table--total">
{% assign rounded_exchange_total = exchange_total | plus: net_exchange_rounding %}
{% if rounded_exchange_total > 0 %}
<tr class="subtotal-line">
<td class="subtotal-line__title">
<p> <span>Paid</span> </p>
</td>
<td class="subtotal-line__value">
<strong>{{ rounded_exchange_total | money_with_currency }}</strong>
</td>
</tr>
{% elsif rounded_exchange_total < 0 %}
<tr class="subtotal-line">
<td class="subtotal-line__title">
<p> <span>Refund</span> </p>
</td>
<td class="subtotal-line__value">
<strong>-{{ rounded_exchange_total | abs | money_with_currency }}</strong>
</td>
</tr>
{% else %}
<tr class="subtotal-line">
<td class="subtotal-line__title">
<p> <span>Adjusted exchange total</span> </p>
</td>
<td class="subtotal-line__value">
<strong>{{ rounded_exchange_total | money_with_currency }}</strong>
</td>
</tr>
{% endif %}
</table>
{% endif %}
</table>