针对现金舍入更新 POS 换货 V2 收据电子邮件通知

如果您的商店使用自定义通知模板,则您可能需要手动更新 POS 换货 V2 收据电子邮件通知,确保收据上显示现金舍入。

这些更改要求您熟悉 Shopify 通知模板中的代码。如果您的模板已高度自定义,而您不确定如何应用必要的更改,请联系进行更改的开发人员,或者点击恢复为默认值以将您的模板恢复为初始状态。恢复为默认值会移除所有自定义设置,但这可确保您拥有最新的模板版本。

更新 POS 换货 V2 收据电子邮件通知

您可以更新 POS 换货 V2 收据通知,在收据中显示换货交易产生的净现金舍入金额,以及舍入后的换货总额。

步骤:

  1. 在 Shopify 后台中,转至设置 > 通知。

  2. 点击客户通知。

  3. 在 POS 部分,点击 POS 换货 V2 收据。

  4. 点击编辑代码。

  5. 添加逻辑来计算净现金舍入金额,并将其加到 exchange_total 中。

    1. 找到包含 <span>Exchange total</span> 的代码块。
    2. 将现有代码块替换为以下代码块,该代码块会计算 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>