การอัปเดตการแจ้งเตือนทางอีเมลเมื่ออนุมัติการคืนสินค้าสำหรับการเปลี่ยนสินค้า

หากร้านค้าของคุณใช้เทมเพลตการแจ้งเตือนที่ปรับแต่งเอง คุณอาจต้องอัปเดตการแจ้งเตือนทางอีเมลเรื่องการอนุมัติการคืนสินค้าด้วยตนเองเพื่อให้แน่ใจว่าใช้งานได้เมื่อคุณเพิ่มสินค้าสำหรับเปลี่ยนในการคืนสินค้า

การเปลี่ยนแปลงเหล่านี้จำเป็นต้องอาศัยความคุ้นเคยกับโค้ดที่ใช้ในเทมเพลตการแจ้งเตือนของ Shopify หากเทมเพลตของคุณมีการปรับแต่งขั้นสูงและคุณไม่แน่ใจว่าจะปรับใช้การเปลี่ยนแปลงที่จำเป็นได้อย่างไร โปรดติดต่อนักพัฒนาที่ทำการเปลี่ยนแปลง หรือคลิกเปลี่ยนกลับเป็นค่าเริ่มต้นเพื่อคืนค่าเทมเพลตของคุณกลับสู่สถานะดั้งเดิม เมื่อคุณเปลี่ยนกลับเป็นค่าเริ่มต้น การปรับแต่งทั้งหมดของคุณจะถูกลบออกไป แต่เทมเพลตเริ่มต้นจะช่วยให้แน่ใจว่าคุณมีเวอร์ชันของเทมเพลตที่เป็นปัจจุบันที่สุด

อัปเดตการแจ้งเตือนทางอีเมลเมื่ออนุมัติการคืนสินค้า

คุณสามารถอัปเดตการแจ้งเตือนการอนุมัติการคืนสินค้าเพื่อให้ครอบคลุมการเปลี่ยนแปลงต่อไปนี้

  • สำหรับการเปลี่ยนสินค้าที่ต้องชำระเงินเพิ่ม ลูกค้าจะได้รับอีเมลการคืนสินค้าที่มีปุ่มชำระเงินตอนนี้สำหรับดำเนินการชำระเงิน การเปลี่ยนแปลงนี้รวมถึงการอัปเดตส่วนคำแนะนำของอีเมลเพื่อแสดงยอดคงเหลือที่ลูกค้าอาจต้องชำระ และคำแนะนำจะถูกย้ายไปที่ด้านบนของอีเมล
  • ส่วนใหม่ที่แสดงสินค้าสำหรับเปลี่ยนใต้หัวข้อสินค้าที่คุณจะได้รับ และเปลี่ยนชื่อส่วนสินค้าที่ส่งคืนเป็นสินค้าที่ต้องส่งคืน
  • อีเมลการคืนสินค้าจะมีข้อมูลสรุปทางการเงินซึ่งรวมค่าใช้จ่ายของสินค้าที่ส่งคืนและสินค้าสำหรับเปลี่ยน ตลอดจนค่าธรรมเนียมการคืนสินค้าที่เกี่ยวข้อง

ขั้นตอน

  1. จากส่วนผู้ดูแล Shopify ของคุณ ให้ไปที่การตั้งค่า > การแจ้งเตือน

  2. คลิกการแจ้งเตือนลูกค้า

  3. ในส่วนการคืนสินค้า ให้คลิกคำขอคืนสินค้าได้รับการอนุมัติแล้ว

  4. คลิกแก้ไขโค้ด

  5. อัปเดตหัวเรื่องย่อยให้มีตรรกะเกี่ยวกับการจัดส่งและยอดคงเหลือของคำสั่งซื้อ ดังนี้

    1. ค้นหาบรรทัดโค้ด {% if has_label_attached %} บรรทัดแรก
    2. แทนที่บล็อกโค้ดที่มีอยู่ด้วยบล็อกโค้ดต่อไปนี้
{% if has_label_attached %}
    Print your return shipping label and attach it to the package containing your return items.
  {% else %}
    {% if return_delivery_first.type == 'shopify_label' and return.order_total_outstanding > 0 %}
      Your return was approved and a balance is due. Pay the outstanding balance, and once you receive your return shipping label, follow the instructions to complete your return.
    {% else %}
      We will send you additional information to complete the return.
    {% endif %}
  {% endif %}
  1. อัปเดตคำแนะนำในการจัดส่งสินค้าคืน
    1. ค้นหาบรรทัดโค้ด <p class="return-approved__body">...</p>
    2. เพิ่มบล็อกโค้ดต่อไปนี้หลังบรรทัดโค้ดดังกล่าว
{% if has_label_attached or has_tracking_number %}
<table class="row section">
  <tr>
    <td class="section__cell">
      <center>
        <table class="container">
          <tr>
            <td>
              <h3>Instructions</h3>
            </td>
          </tr>
        </table>
        <table class="container">
          <tr>
            <td>
              <ol class="return-approved__instructions">
                <li class="return-approved__instruction-step">Pack the items you're returning.</li>
                {% if return.checkout_payment_collection_url %}
                  <li class="return-approved__instruction-step">Pay the outstanding balance.</li>
                {% endif %}
                <li class="return-approved__instruction-step">Print your return label and attach it to the package. Cover or remove any old shipping labels.</li>
                <li class="return-approved__instruction-step">
                  {% if return_delivery_first.carrier_name %}
                    Give the package to {{ return_delivery_first.carrier_name }}.
                  {% else %}
                    Give the package to the carrier identified on the label.
                  {% endif %}
                </li>
                {% if has_tracking_number %}
                  <li class="return-approved__instruction-step">Track your return to make sure we get it.</li>
                {% endif %}
              </ol>
              {% if has_tracking_number %}
                <p class="return-approved__tracking-number">
                  {% if return_delivery_first.carrier_name %}
                      {{ return_delivery_first.carrier_name }} tracking number: <a target="_blank" href="{{ return_delivery_first.tracking_url) }}">{{ return_delivery_first.tracking_number) }}</a>
                  {% else %}
                      Tracking number: <a target="_blank" href="{{ return_delivery_first.tracking_url) }}">{{ return_delivery_first.tracking_number) }}</a>
                  {% endif %}
                </p>
              {% endif %}
            </td>
          </tr>
        </table>
      </center>
    </td>
  </tr>
</table>
{% endif %}
  1. อัปเดตคำกระตุ้นให้ดำเนินการเพื่อรวม ชำระเงินตอนนี้ ตรรกะ
    1. ค้นหาบรรทัดโค้ด <table class="row actions">...</table>
    2. แทนที่บล็อกโค้ดที่มีอยู่ด้วยบล็อกโค้ดต่อไปนี้
{% if has_label_attached %}
  {% capture url_primary %}{{ public_file_url }}{% endcapture %}
  {% capture text_primary %}Print return label{% endcapture %}
  {% capture url_secondary %}{{ return.checkout_payment_collection_url }}{% endcapture %}
  {% capture text_secondary %}Pay now{% endcapture %}

  <table class="row actions">
    <tr>
      <td class="empty-line">&nbsp;</td>
    </tr>
    <tr>
      <td class="actions__cell">
        {% if url_primary != blank or url_secondary != blank %}
          {% 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>
        {% else %}
        <table class="button main-action-cell">
          <tr>
            <td class="button__cell">
              <a href="{{ order.order_status_url }}" class="button__text">View your order</a>
            </td>
          </tr>
        </table>
        {% endif %}
      </td>
    </tr>
  </table>

{% else %}
  {% capture url_primary %}{{ return.checkout_payment_collection_url }}{% endcapture %}
  {% capture text_primary %}Pay now{% endcapture %}
  {% capture url_secondary %}{% endcapture %}
  {% capture text_secondary %}{% endcapture %}

  <table class="row actions">
    <tr>
      <td class="empty-line">&nbsp;</td>
    </tr>
    <tr>
      <td class="actions__cell">
        {% if url_primary != blank or url_secondary != blank %}
          {% 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>
        {% else %}
        <table class="button main-action-cell">
          <tr>
            <td class="button__cell">
              <a href="{{ order.order_status_url }}" class="button__text">View your order</a>
            </td>
          </tr>
        </table>
        {% endif %}
      </td>
    </tr>
  </table>

{% endif %}
  1. ลบคำแนะนำเก่าที่ด้านล่างของการแจ้งเตือน
    1. ค้นหาบรรทัดโค้ด <h3>Instructions</h3>
    2. ค้นหาและลบบล็อกโค้ด <table class="row section">...</table> ทั้งหมด
  2. เพิ่มสินค้าเฉพาะรายการสำหรับเปลี่ยนและอัปเดตชื่อรายการสินค้าที่ส่งคืน
    1. ค้นหาแท็ก <h3>Return summary</h3>
    2. แทนที่ตารางด้านนอกที่ตรงกับ <table class="row section"> ด้วยบล็อกต่อไปนี้
{%- if return.line_items.size > 0 -%}
<table class="row section">
  <tr>
    <td class="section__cell">
      <center>
        <table class="container">
          <tr>
            <td>
              <h3>Items to return</h3>
            </td>
          </tr>
        </table>
        <table class="container">
          <tr>
            <td>

<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 %}
              <p>
                <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>
              </p>
              {% 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 %}
              {% capture final_line_price %}
                  {{ line_item.final_line_price | money }}
              {% endcapture %}
              {{ final_line_price }}
            {% else %}
              Free
            {% endif %}
          </p>
        </td>
      </table>
    </td>
  </tr>
  {% endfor %}
</table>


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

        {%- if return.exchange_line_items.size > 0 -%}
          <table class="row section">
  <tr>
    <td class="section__cell">
      <center>
        <table class="container">
          <tr>
            <td>
              <h3>Items you'll receive</h3>
            </td>
          </tr>
        </table>
        <table class="container">
          <tr>
            <td>


<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 %}
              <p>
                <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>
              </p>
              {% 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 %}
              {% capture final_line_price %}
                  {{ line_item.final_line_price | money }}
              {% endcapture %}
              {{ final_line_price }}
            {% else %}
              Free
            {% endif %}
          </p>
        </td>
      </table>
    </td>
  </tr>
  {% endfor %}
</table>


            </td>
          </tr>
        </table>
      </center>
    </td>
  </tr>
</table>
{%- endif -%}
  1. เพิ่มข้อมูลทางการเงินและค่าธรรมเนียมการคืนสินค้า เพิ่มบล็อกต่อไปนี้หลังจากการเปลี่ยนแปลงจากขั้นตอนก่อนหน้า หรือเพิ่มบล็อกก่อนบรรทัดโค้ด <table class="row footer">
<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 %}
              <p>
                <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>
              </p>
              {% 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 %}
              {% capture final_line_price %}
                  {{ line_item.final_line_price | money }}
              {% endcapture %}
              {{ final_line_price }}
            {% else %}
              Free
            {% endif %}
          </p>
        </td>
      </table>
    </td>
  </tr>
  {% endfor %}
</table>


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

        <table class="row content">
  <tr>
    <td class="content__cell">
      <center>
        <table class="container">
          <tr>
            <td>

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

        {% capture line_items_subtotal_price %}
          {% if return.line_items_subtotal_price < 0 %}
            -{{ return.line_items_subtotal_price  | abs | money }}
          {% else %}
            {{ return.line_items_subtotal_price | money }}
          {% endif %}
        {% endcapture %}


<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      <span>Subtotal</span>
    </p>
  </td>
  <td class="subtotal-line__value">
      <strong>{{ line_items_subtotal_price }}</strong>
  </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">
      <strong>{{ fee.subtotal | money }}</strong>
  </td>
</tr>

{% endfor %}


        {% if return.total_tax_price %}
          {% capture total_tax_price %}
            {% if return.total_tax_price < 0 %}
              -{{ return.total_tax_price | abs | money }}
            {% else %}
              {{ return.total_tax_price | money }}
            {% endif %}
          {% endcapture %}

<tr class="subtotal-line">
  <td class="subtotal-line__title">
    <p>
      <span>Estimated taxes</span>
    </p>
  </td>
  <td class="subtotal-line__value">
      <strong>{{ total_tax_price }}</strong>
  </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>
      </center>
    </td>
  </tr>
</table>
  1. คลิกบันทึก