更新 POS 换货 V2 收据电子邮件通知以支持现金舍入
如果您的商店使用 自定义通知模板,则可能需要手动更新您的“POS 换货 V2 收据”电子邮件通知,以确保它在收据上显示 现金舍入 金额。
这些更改要求您熟悉 Shopify 通知模板中使用的代码。如果您的模板是高度自定义的,并且您不确定如何应用必要的更改,请联系进行更改的开发人员,或点击恢复为默认设置以将模板恢复到其原始状态。恢复为默认设置后,您的所有自定义项都将被删除,但默认模板可确保您拥有最新的模板版本。
更新 POS 换货 V2 收据电子邮件通知
您可以更新“POS 换货 V2 收据”通知,以显示换货交易产生的净现金舍入金额,以及收据中舍入后的换货总金额。
步骤:
在 Shopify 后台中,转至设置 > 通知。
点击客户通知。
在“POS”部分中,点击“POS 换货 V2 收据”。
点击编辑代码。
添加用于计算净现金舍入金额的逻辑,并将其添加到
exchange_total。- 找到包含
<span>Exchange total</span>的代码块。 - 将现有代码块替换为以下代码块,该代码块会计算
net_exchange_rounding并将其添加到exchange_total中:
- 找到包含
<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>