更新 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>