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