Cập nhật thông báo qua email về việc tạo đơn hàng trả lại đối với hoạt động đổi hàng

Nếu cửa hàng sử dụng mẫu thông báo tùy chỉnh, bạn có thể cần cập nhật thủ công thông báo qua email Tạo đơn hàng trả lại để đảm bảo thông báo hoạt động bình thường khi bạn thêm mặt hàng đổi vào đơn hàng trả lại.

Những thay đổi này yêu cầu bạn phải quen thuộc với mã dùng trong mẫu thông báo của Shopify. Nếu mẫu được tùy chỉnh nhiều và bạn không chắc chắn cách áp dụng các thay đổi cần thiết, hãy liên hệ với nhà phát triển đã thực hiện thay đổi hoặc nhấp vào Khôi phục về mặc định để khôi phục mẫu về trạng thái ban đầu. Khi bạn khôi phục về mặc định, mọi tùy chỉnh sẽ bị xóa, nhưng mẫu mặc định đảm bảo bạn có phiên bản mẫu mới nhất.

Cập nhật thông báo qua email Tạo đơn hàng trả lại

Bạn có thể cập nhật thông báo Tạo đơn hàng trả lại để bao gồm các thay đổi sau:

  • Đối với hoạt động đổi hàng có khoản cần thanh toán, khách hàng hiện có thể nhận được thao tác thanh toán (nút Thanh toán ngay) trong email trả hàng. Việc này bao gồm cập nhật phần hướng dẫn của email để phản ánh số dư chưa thanh toán mà khách hàng có thể nợ và hướng dẫn được chuyển lên đầu trang email.
  • Phần mới hiển thị mặt hàng đổi dưới tiêu đề Mặt hàng bạn sẽ nhận và đổi tên phần Mặt hàng đã trả lại thành Mặt hàng cần trả lại.
  • Phần tóm tắt tài chính được đưa vào email trả hàng, bao gồm giá thành của đơn hàng trả lại và mặt hàng đổi, cùng với các khoản phí trả hàng áp dụng.

Các bước thực hiện:

  1. Từ bảng điều khiển quản trị Shopify, đi tới Cài đặt > Thông báo.

  2. Nhấp vào Thông báo của khách hàng.

  3. Trong phần Đơn hàng trả lại, nhấp vào Đã tạo đơn hàng trả lại.

  4. Nhấp vào Chỉnh sửa mã.

  5. Xác định vị trí đầu tiên của {% if return_delivery.type == 'shopify_label' %}, rồi cập nhật hướng dẫn Vận chuyển đơn hàng trả lại:

    1. Tìm dòng mã <p class="return-creation__subtitle">...</p>.
    2. Thêm khối mã sau đây vào phía sau dòng mã:
<div class="return-label-beta__instructions">
                <h2>Instructions</h2>

                <ol>
                  <li>Pack the items you're returning.</li>
                  {% if return.checkout_payment_collection_url %}
                    <li>Pay the outstanding balance.</li>
                  {% endif %}
                  <li>Print your return shipping label. If you haven't received it yet, we'll send it to you soon.</li>
                  <li>Attach the label to the package. Cover or remove any old shipping labels.</li>
                  <li>
                    {% if return_delivery.carrier_name %}
                      Give the package to {{ return_delivery.carrier_name }}.
                    {% else %}
                      Give the package to the carrier identified on the label.
                    {% endif %}
                  </li>
                  <li>
                    Track your return using <a target="_blank" href="{{ return_delivery.tracking_url) }}">your tracking number</a> to make sure we get it.
                  </li>
                </ol>
              </div>
  1. Cập nhật lời kêu gọi hành động để đưa vào logic Thanh toán ngay :
    1. Tìm dòng mã <table class="row actions">...</table>.
    2. Thay thế khối mã hiện tại bằng khối mã sau:
{% capture url_primary %}{{ return.checkout_payment_collection_url }}{% endcapture %}
{% capture text_primary %}Pay now{% endcapture %}
{% capture url_secondary %}{% endcapture %}
{% capture text_secondary %}{% endcapture %}
{% if url_primary != blank or url_secondary != blank %}
<table class="row actions">
  <tr>
    <td class="empty-line">&nbsp;</td>
  </tr>
  <tr>
    <td class="actions__cell">
      {% if url_primary != blank %}
      <table class="button main-action-cell">
        <tr>
          <td class="button__cell">
            <a href="{{ url_primary }}" class="button__text">{{ text_primary }}</a>
          </td>
        </tr>
      </table>
      {% endif %}
      {% if url_secondary != blank %}
      <table class="button return__mobile-padding main-action-cell">
        <tr>
          <td class="button__cell">
            <a href="{{ url_secondary }}" class="button__text return__main-button">{{ text_secondary }}</a>
          </td>
        </tr>
      </table>
      {% endif %}
{% endif %}
  1. Xác định vị trí đầu tiên của {% elsif return_delivery.type == 'manual' %}, rồi cập nhật hướng dẫn Vận chuyển thủ công đơn hàng trả lại:
    1. Tìm dòng mã <p class="return-creation__subtitle">...</p>.
    2. Thêm khối mã sau đây vào phía sau dòng mã:
<div class="return-label-beta__instructions">
                <h2>Instructions</h2>

                <ol>
                  <li>Pack the items you're returning.</li>
                  {% if return.checkout_payment_collection_url %}
                    <li>Pay the outstanding balance.</li>
                  {% endif %}
                  <li>Print your return shipping label. If you haven't received it yet, we'll send it to you soon.</li>
                  <li>Attach the label to the package. Cover or remove any old shipping labels.</li>
                  <li>
                    {% if return_delivery.carrier_name %}
                      Give the package to {{ return_delivery.carrier_name }}.
                    {% else %}
                      Give the package to the carrier identified on the label.
                    {% endif %}
                  </li>
                  <li>
                    Track your return using <a target="_blank" href="{{ return_delivery.tracking_url) }}">your tracking number</a> to make sure we get it.
                  </li>
                </ol>
              </div>
  1. Thêm khối mã sau vào sau bước trước đó trong khối mã {% elsif return_delivery.type == 'manual' %}:
{% capture url_primary %}{{ return.checkout_payment_collection_url }}{% endcapture %}
{% capture text_primary %}Pay now{% endcapture %}
{% capture url_secondary %}{% endcapture %}
{% capture text_secondary %}{% endcapture %}
{% if url_primary != blank or url_secondary != blank %}
<table class="row actions">
  <tr>
    <td class="empty-line">&nbsp;</td>
  </tr>
  <tr>
    <td class="actions__cell">
      {% if url_primary != blank %}
      <table class="button main-action-cell">
        <tr>
          <td class="button__cell">
            <a href="{{ url_primary }}" class="button__text">{{ text_primary }}</a>
          </td>
        </tr>
      </table>
      {% endif %}
      {% if url_secondary != blank %}
      <table class="button return__mobile-padding main-action-cell">
        <tr>
          <td class="button__cell">
            <a href="{{ url_secondary }}" class="button__text return__main-button">{{ text_secondary }}</a>
          </td>
        </tr>
      </table>
      {% endif %}
      <table class="link secondary-action-cell">
        <tr>
          <td class="link__cell">or <a target="_blank" href="{{ order.order_status_url }}">View your order</a></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
{% endif %}
  1. Xóa hướng dẫn cũ ở cuối thông báo:
    1. Tìm dòng mã <h3>Instructions</h3>.
    2. Tìm và xóa toàn bộ khối mã <table class="row section">...</table> bắt đầu từ bảy dòng phía trên <h3>Instructions</h3>.
  2. Thêm mục hàng đổi và cập nhật tiêu đề mặt hàng trả lại:
    1. Tìm thẻ <h3>Returned items</h3>.
    2. Tìm và thay thế toàn bộ khối mã <table class="row section">...</table> bắt đầu từ bảy dòng phía trên <h3>Returned items</h3> bằng khối mã sau:
<table class="row content">
  <tr>
    <td class="content__cell">
      <center>
        <table class="container">
          <tr>
            <td>

          <h2>Items to return</h2>
          <table class="row">
  {% for line_item in return.line_items %}
  <tr class="order-list__item">
    <td class="order-list__item__cell">
      <table>
        <td>
          {% if line_item.image %}
            <img src="{{ line_item | img_url: 'compact_cropped' }}" align="left" width="60" height="60" class="order-list__product-image"/>
          {% endif %}
        </td>
        <td class="order-list__product-description-cell">
          {% assign line_display = line_item.quantity  %}

          <span class="order-list__item-title">{{ line_item.title_without_variant }}&nbsp;&times;&nbsp;{{ line_display }}</span><br/>

          {% if line_item.variant.title != 'Default Title' %}
            <span class="order-list__item-variant">{{ line_item.variant.title }}</span><br/>
          {% endif %}

          {% if line_item.discount_allocations %}
            {% for discount_allocation in line_item.discount_allocations %}
              {% if discount_allocation.amount > 0 %}
                <span class="order-list__item-discount-allocation">
                  <img src="{{ 'notifications/discounttag.png' | shopify_asset_url }}" width="18" height="18" class="discount-tag-icon" />
                  <span>
                    {{ discount_allocation.discount_application.title | upcase }}
                    (-{{ discount_allocation.amount | money }})
                  </span>
                </span>
              {% endif %}
            {% endfor %}
          {% endif %}
        </td>

        <td class="order-list__price-cell">
          {% if line_item.original_line_price != line_item.final_line_price %}
            <del class="order-list__item-original-price">{{ line_item.original_line_price | money }}</del>
          {% endif %}
          <p class="order-list__item-price">
            {% if line_item.final_line_price > 0 %}
              {{ line_item.final_line_price | money }}
            {% else %}
              Free
            {% endif %}
          </p>
        </td>
      </table>
    </td>
  </tr>
  {% endfor %}
</table>


            </td>
          </tr>
        </table>
      </center>
    </td>
  </tr>
</table>

        {% if return.exchange_line_items.size > 0 %}
          <table class="row content">
  <tr>
    <td class="content__cell">
      <center>
        <table class="container">
          <tr>
            <td>

            <h2>Items you'll receive</h2>
            <table class="row">
  {% for line_item in return.exchange_line_items %}
  <tr class="order-list__item">
    <td class="order-list__item__cell">
      <table>
        <td>
          {% if line_item.image %}
            <img src="{{ line_item | img_url: 'compact_cropped' }}" align="left" width="60" height="60" class="order-list__product-image"/>
          {% endif %}
        </td>
        <td class="order-list__product-description-cell">
          {% assign line_display = line_item.quantity  %}

          <span class="order-list__item-title">{{ line_item.title_without_variant }}&nbsp;&times;&nbsp;{{ line_display }}</span><br/>

          {% if line_item.variant.title != 'Default Title' %}
            <span class="order-list__item-variant">{{ line_item.variant.title }}</span><br/>
          {% endif %}

          {% if line_item.discount_allocations %}
            {% for discount_allocation in line_item.discount_allocations %}
              {% if discount_allocation.amount > 0 %}
                <span class="order-list__item-discount-allocation">
                  <img src="{{ 'notifications/discounttag.png' | shopify_asset_url }}" width="18" height="18" class="discount-tag-icon" />
                  <span>
                    {{ discount_allocation.discount_application.title | upcase }}
                    (-{{ discount_allocation.amount | money }})
                  </span>
                </span>
              {% endif %}
            {% endfor %}
          {% endif %}
        </td>

        <td class="order-list__price-cell">
          {% if line_item.original_line_price != line_item.final_line_price %}
            <del class="order-list__item-original-price">{{ line_item.original_line_price | money }}</del>
          {% endif %}
          <p class="order-list__item-price">
            {% if line_item.final_line_price > 0 %}
              {{ line_item.final_line_price | money }}
            {% else %}
              Free
            {% endif %}
          </p>
        </td>
      </table>
    </td>
  </tr>
  {% endfor %}
</table>


            </td>
          </tr>
        </table>
      </center>
    </td>
  </tr>
</table>
        {% endif %}
  1. Đưa vào thông tin tài chính và phí trả hàng. Thêm khối sau vào sau những thay đổi từ bước trước đó hoặc thêm khối vào trước dòng mã <table class="row footer">:
<table class="row section">
  <tr>
    <td class="section__cell">
      <center>
        <table class="container">
          <tr>
            <td>

          <table class="row subtotal-lines">
  <tr>
    <td class="subtotal-spacer"></td>
    <td>
      <table class="row subtotal-table">

<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      <span>Subtotal</span>
    </p>
  </td>
  <td class="subtotal-line__value">
      <span>{{ return.line_items_subtotal_price | money }}</span>
  </td>
</tr>


        {% assign fees = return.fees %}
        {% for fee in fees %}

<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      <span>{{ fee.title }}</span>
    </p>
  </td>
  <td class="subtotal-line__value">
      <span>{{ fee.subtotal | money }}</span>
  </td>
</tr>

{% endfor %}


        {% if return.total_tax_price > 0 %}

<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      <span>Estimated taxes</span>
    </p>
  </td>
  <td class="subtotal-line__value">
      <span>{{ return.total_tax_price | money }}</span>
  </td>
</tr>

        {% endif %}

        {% if return.total_price > 0 %}
        <table class="row subtotal-table subtotal-table--total">

<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      <span>Amount to pay</span>
    </p>
  </td>
  <td class="subtotal-line__value">
      <strong>{{ return.total_price | money_with_currency }}</strong>
  </td>
</tr>

        </table>
        {% elsif return.total_price <= 0 %}
        <table class="row subtotal-table subtotal-table--total">

<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      <span>Estimated refund</span>
    </p>
  </td>
  <td class="subtotal-line__value">
      <strong>{{ return.total_price | abs | money_with_currency }}</strong>
  </td>
</tr>

        </table>
        {% endif %}
      </table>
    </td>
  </tr>
</table>


            </td>
          </tr>
        </table>
  1. Nhấp vào Lưu.