현금 반올림을 위한 POS 교환 V2 영수증 이메일 알림 업데이트
스토어에서 맞춤 설정한 알림 템플릿을 사용하는 경우, 영수증에 반올림된 현금 금액을 표시하려면 POS 교환 V2 영수증 이메일 알림을 수동으로 업데이트해야 할 수 있습니다.
이렇게 변경하려면 Shopify의 알림 템플릿에 사용되는 코드를 잘 알고 있어야 합니다. 템플릿이 고도로 사용자 지정되어 있으며 필요한 변경 사항을 적용하는 방법을 잘 모르겠다면 변경한 개발자에게 문의하거나 기본값으로 되돌리기를 클릭하여 템플릿을 원래 상태로 복원하세요. 기본값으로 되돌리면 모든 맞춤 설정 사항이 제거되지만 해당 템플릿이 최신 버전이 됩니다.
이 페이지의 정보
POS 교환 V2 영수증 이메일 알림 업데이트
POS 교환 V2 영수증 알림을 업데이트하여 교환 거래에서 발생한 순 현금 반올림 금액과 반올림된 총 교환 금액을 영수증에 표시할 수 있습니다.
단계:
Shopify Admin에서 설정 > 알림으로 이동합니다.
고객 알림을 클릭합니다.
POS(Point of Sale) 섹션에서 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>