套装分组视图电子邮件通知模板更新

自 2024 年 12 月 6 日起,包含套装的订单现在将在您的许多电子邮件模板中显示为嵌套的订单项目组

任何使用默认模板的通知模板都已自动更新,以显示产品套装的分组视图。如果您在 2024 年 12 月 6 日之前自定义了任何电子邮件通知模板,则您的通知模板不会更新。要将通知模板更新为套装视图,您可以使用以下方法:

  • 对于 设置 > 通知 部分中的所有通知,您可以使用以下任一方法:
    • 备份您的自定义内容,还原模板,然后重新应用您的自定义内容。
    • 通过编辑代码将 套装组件 Liquid 对象添加到模板中来更新您当前的自定义内容。
  • 对于使用 Shopify Messaging 的弃单自动化,您可以编辑自动化中的现有模板以将其还原。

更新自定义电子邮件模板的注意事项

对电子邮件通知模板进行任何更改之前,请查看以下注意事项:

  • Shopify 后台中设置 > 通知 部分的通知模板包含 Liquid(Shopify 的模板语言)、HTML 和 CSS。只有在您了解 HTML 和 CSS 并对 Liquid 有基本了解的情况下,才能编辑通知模板的代码。
  • 保存对通知模板的更改会覆盖以前的模板代码。您可以将模板还原为默认模板,但如果这样做,您之前对模板代码的自定义内容将会丢失且无法恢复。
  • 如果您想更新模板,但没有编辑通知模板代码的经验,则可以寻求帮助:
    • Shopify 支持团队无法为您大幅编辑通知模板,但在 Shopify 设计政策的权限范围内,也许能够帮助您对免费的 Shopify 模板进行细微调整。
    • 如需进行较复杂的更改,请聘请 Shopify 合作伙伴

分组视图更改前后对比

在更新电子邮件通知模板之前,产品套装显示为单独的订单项目:

分组视图更改前

更新电子邮件通知模板后,产品套装显示为嵌套的订单项目组:

分组视图更改后

已针对产品套装更新的电子邮件通知列表

以下通知模板会显示产品套装的分组视图或平铺视图。

客户通知

针对产品套装分组视图更新的电子邮件通知的描述
通知模板后台位置显示类型
订单确认订单处理套装显示为嵌套组。
订单发票订单异常套装显示为嵌套组。
待处理的付款错误付款套装显示为嵌套组。
待处理的付款成功付款套装显示为嵌套组。
发送给客户的 POS 电子邮件POS套装显示为嵌套组。
POS 和移动设备收据POS套装显示为嵌套组。
已创建退货退货套装中的每件产品都显示为单独的商品。
已收到退货请求退货套装中的每件产品都显示为单独的商品。
退货请求已批准退货套装中的每件产品都显示为单独的商品。
退货请求已拒绝退货套装中的每件产品都显示为单独的商品。

员工通知

针对产品套装分组视图更新的电子邮件通知的描述
通知模板显示类型
新订单套装显示为嵌套组。
新退货请求套装中的每件产品都显示为单独的商品。
销售归因已编辑套装中的每件产品都显示为单独的商品。
新草稿订单套装显示为嵌套组。
弃单(在 Shopify Messaging 中)套装显示为嵌套组。

还原自定义通知模板

要更新 Shopify 后台中设置 > 通知 部分的自定义通知模板,您可以手动备份对电子邮件模板的任何自定义内容,将模板还原为默认模板,然后重新应用您的自定义内容。

步骤:

台式电脑
  1. 在 Shopify 后台中,转至设置 > 通知

  2. 点击客户通知员工通知

  3. 点击要更新的通知。

  4. 点击编辑代码

  5. 在模板中选中您想保留的自定义内容,复制其代码,然后将其保存在安全的位置(例如文本文件)以备份现有自定义内容。

  6. 点击恢复为默认值。恢复后,您的自定义内容将无法恢复,因此请确保您已安全备份所做的更改。

  7. 在对话框中,点击恢复更改进行确认。

  8. 将您的自定义内容重新应用到更新后的模板。

  9. 点击保存

移动设备
  1. Shopify 应用中,轻触 Menu,然后轻触 Settings 设置

  2. 商店设置部分中,轻触 通知

  3. 轻触客户通知员工通知

  4. 轻触您要更新的通知。

  5. 轻触 编辑代码 按钮以编辑模板代码。

  6. 在模板中选中您想保留的自定义内容,复制其代码,然后将其保存在安全的位置(例如文本文件)以备份现有自定义内容。

  7. 轻触恢复为默认值。恢复后,您的自定义内容将无法恢复,因此请确保您已安全备份所做的更改。

  8. 在对话框中,轻触恢复更改进行确认。

  9. 将您的自定义内容重新应用到更新后的模板。

  10. 轻触保存

编辑您的自定义电子邮件模板代码

如果您自定义了电子邮件模板的代码,则可以手动更新该代码以支持产品套装的分组视图。每个模板的默认代码各不相同。若要在 Shopify 后台的设置 > 通知部分中更新自定义的通知模板,请按照您需要编辑的每个模板的说明进行操作。

更新订单电子邮件通知

请按照以下步骤更新以下订单电子邮件通知的自定义模板:

  • 订单确认
  • 新订单电子邮件
  • 订单发票
  • 待处理的付款成功
  • 待处理的付款错误
  • POS 和移动设备收据

步骤:

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

  2. 点击客户通知员工通知

  3. 点击要更新的通知。

  4. 点击编辑代码

  5. 在模板中选中您想保留的自定义内容,复制其代码,然后将其保存在安全的位置(例如文本文件),以备份您现有的自定义内容。您也可以选中整个模板,将其复制并保存在安全位置。

  6. 通过搜索 subtotal_line_items,在模板中查找订单项目循环。它将显示如下内容:

{% for line in subtotal_line_items %}
  1. 通过在开始的 subtotal_line_items 循环正下方添加 {% if line.groups.size == 0 %},将 subtotal_line_items 循环内的所有代码包裹在 if 条件中,然后通过在结束的 {% endfor %} 循环正上方添加 {% endif %} 来闭合 if 条件。
{% if line.groups.size == 0 %}
        <Your old code>
    {% endif %}
  1. 您的代码应如下所示:
{% for line in subtotal_line_items %}
        {% if line.groups.size == 0 %}
            <Your old code>
        {% endif %}
    {% endfor %}
  1. 将以下代码粘贴到 subtotal_line_items 订单项目循环的 {% endfor %} 结束标记之后:
{% for line_item_group in line_item_groups %}

        {% assign final_line_price = 0 %}
        {% assign original_line_price = 0 %}
        {% assign discount_keys_str = "" %}

    {% for component in line_item_group.components %}
        {% assign final_line_price = final_line_price | plus: component.final_line_price %}
        {% assign original_line_price = original_line_price | plus: component.original_line_price %}

        {% for da in component.discount_allocations %}
            {% if da.discount_application.target_selection != 'all' %}
                {% assign discount_key = da.discount_application.title | append: da.discount_application.type %}
                {% assign discount_keys_str = discount_keys_str | append: discount_key | append: "," %}
            {% endif %}
        {% endfor %}
    {% endfor %}

    {% assign discount_keys = discount_keys_str | split: "," | uniq %}

        <tr class="order-list__item">
            <td class="order-list__item__cell">
                <table>
                    <td class="order-list__parent-image-cell">
                        {% if line_item_group.image %}
                            <img src="{{ line_item_group | img_url: 'compact_cropped' }}" align="left" width="60" height="60" class="order-list__product-image"/>
                        {% else %}
                            <div class="order-list__no-image-cell">
                                <img src="{{ 'notifications/no-image.png' | shopify_asset_url }}" align="left" width="60" height="60" class="order-list__no-product-image"/>
                            </div>
                        {% endif %}
                    </td>
                    <td class="order-list__product-description-cell">
                        <span class="order-list__item-title">{{ line_item_group.title }}&nbsp;&times;&nbsp;{{ line_item_group.quantity }}</span><br/>

                        {% for discount_key in discount_keys %}
                            {% assign discount_amount = 0 %}

                            {% for component in line_item_group.components %}
                                {% for da in component.discount_allocations %}
                                    {% assign key = da.discount_application.title | append: da.discount_application.type %}
                                    {% if da.discount_application.target_selection != 'all' and key == discount_key %}
                                        {% assign discount_amount = discount_amount | plus: da.amount %}
                                        {% assign discount_title = da.discount_application.title %}
                                    {% endif %}
                                {% endfor %}
                            {% endfor %}

                            <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_title | upcase }}
                                        (-{{ discount_amount | money }})
                                    </span>
                                </span>
                            </p>
                        {% endfor %}

                        {% for component in line_item_group.components %}
                            <table>
                                <tr class="order-list__item">
                                    <td class="order-list__bundle-item">
                                        <table>
                                            <td class="order-list__image-cell">
                                                {% if component.image %}
                                                    <img src="{{ component | img_url: 'compact_cropped' }}" align="left" width="40" height="40" class="order-list__product-image"/>
                                                {% else %}
                                                    <div class="order-list__no-image-cell small">
                                                        <img src="{{ 'notifications/no-image.png' | shopify_asset_url }}" align="left" width="40" height="40" class="order-list__no-product-image small"/>
                                                    </div>
                                                {% endif %}
                                            </td>

                                            <td class="order-list__product-description-cell">
                                                {% if component.product.title %}
                                                    {% assign component_title = component.product.title %}
                                                {% else %}
                                                    {% assign component_title = component.title %}
                                                {% endif %}

                                                <span class="order-list__item-title">{{ component.quantity }}&nbsp;&times;&nbsp;{{ component_title }}</span><br>

                                                {% if component.variant.title != 'Default Title'%}
                                                    <span class="order-list__item-variant">{{ component.variant.title }}</span>
                                                {% endif %}
                                            </td>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        {% endfor %}
                    </td>

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

    <table class="row subtotal-lines">
        <tr>
            <td class="subtotal-spacer"></td>
            <td>
                <table class="row subtotal-table">
                    {% assign total_order_discount_amount = 0 %}
                    {% assign has_shipping_discount = false %}
                    {% assign epsilon = 0.00001 %}

                    {% for discount_application in discount_applications %}
                        {% if discount_application.target_selection == 'all' and discount_application.target_type == 'line_item' %}
                            {% assign order_discount_count = order_discount_count | plus: 1 %}
                            {% assign total_order_discount_amount = total_order_discount_amount | plus: discount_application.total_allocated_amount %}
                        {% endif %}
                        {% if discount_application.target_type == 'shipping_line' %}
                            {% assign has_shipping_discount = true %}
                            {% assign shipping_discount_title = discount_application.title %}
                            {% if discount_application.total_allocated_amount == 0 %}
                                {% assign discount_value_price = discount_application.value | times: 100 %}
                            {% else %}
                                {% assign discount_value_price = discount_application.total_allocated_amount %}
                            {% endif %}
                            {% assign shipping_amount_minus_discount_value_price = shipping_price | minus: discount_value_price %}
                            {% assign shipping_amount_minus_discount_value_price_abs = shipping_amount_minus_discount_value_price | abs %}
                            {% assign discount_application_value_type = discount_application.value_type | strip %}
                            {% if shipping_amount_minus_discount_value_price_abs < epsilon or discount_application_value_type == 'percentage' and discount_application.value == 100 %}
                                {% assign free_shipping = true %}
                            {% else %}
                                {% assign discounted_shipping_price = shipping_amount_minus_discount_value_price %}
                            {% endif %}
                        {% endif %}
                    {% endfor %}
                </table>
            </td>
        </tr>
    </table>
  1. 点击保存

更新草稿订单和弃单电子邮件通知

请按照以下步骤更新以下电子邮件通知的自定义模板:

  • 新草稿订单
  • 弃购
  • 草稿订单发票
  • 发送给客户的 POS 电子邮件

步骤:

台式电脑
  1. 在 Shopify 后台中,转至设置 > 通知

  2. 点击客户通知员工通知

  3. 点击要更新的通知。

  4. 点击编辑代码

  5. 在模板中选中您想保留的自定义内容,复制其代码,然后将其保存在安全的位置(例如文本文件)以备份现有自定义内容。

  6. 通过搜索 subtotal_line_items,在模板中查找订单项目循环。它将显示如下内容:

{% for line in subtotal_line_items %}
  1. 将以下代码粘贴在 {% for line in subtotal_line_items %} 开始循环的正后方:
{% assign expand_bundles = true %}
  1. 查找用于呈现产品图片的代码块。它应如下所示:
<td class="order-list__image-cell">
            {% if line.image %}
                <img src="{{ line | img_url: 'compact_cropped' }}" align="left" width="60" height="60" class="order-list__product-image"/>
            {% else %}
                <div class="order-list__no-image-cell">
                <img src="{{ 'notifications/no-image.png' | shopify_asset_url }}" align="left" width="60" height="60" class="order-list__no-product-image"/>
                </div>
            {% endif %}
        </td>
  1. 请修改 order-list__image-cell 类:将其包装在 {% if expand_bundles and line.bundle_parent? %} if 条件中,并添加一个备用类。此操作会更改图片模板,当 {% assign expand_bundles = true %} 变量为 true 时,图片类将从 order-list__parent-image-cell 更改为 order-list__image-cell。您的模板代码应如下所示:
<td
            {% if expand_bundles and line.bundle_parent? %}
                class="order-list__parent-image-cell"
            {% else %}
                class="order-list__image-cell"
            {% endif %}
            >
            {% if line.image %}
                <img src="{{ line | img_url: 'compact_cropped' }}" align="left" width="60" height="60" class="order-list__product-image"/>
            {% else %}
                <div class="order-list__no-image-cell">
                <img src="{{ 'notifications/no-image.png' | shopify_asset_url }}" align="left" width="60" height="60" class="order-list__no-product-image"/>
                </div>
            {% endif %}
        </td>
  1. 查找用于呈现多属性标题的代码。它应如下所示:
{% if line.variant.title != 'Default Title' %}
        <span class="order-list__item-variant">{{ line.variant.title }}</span><br/>
    {% endif %}
  1. 要隐藏产品套装的多属性标题,请将 and line.bundle_parent? == false 添加到 {% if line.variant.title != 'Default Title' %} if 条件中,然后添加一个 elsif 条件。它将显示如下内容:
{% if line.variant.title != 'Default Title' and line.bundle_parent? == false %}
        <span class="order-list__item-variant">{{ line.variant.title }}</span><br/>
    {% elsif line.variant.title != 'Default Title' and line.bundle_parent? and expand_bundles == false %}
        <span class="order-list__item-variant">{{ line.variant.title }}</span><br/>
    {% endif %}
  1. 可选:查找用于呈现价格的代码。它应具有 order-list__price-cell 类。弃购电子邮件通知中没有此代码,但草稿订单通知模板中有。它应如下所示:
<td class="order-list__price-cell">
  1. 为价格添加 if 语句和附加类以更新主套装的价格。它应如下所示:
<td
    {% if expand_bundles and line.bundle_parent? %}
        class="order-list__parent-price-cell"
    {% else %}
        class="order-list__price-cell"
    {% endif %}
    >
  1. {% for group in line.groups %} for 循环中搜索 flat viewPart of: 代码。旧电子邮件模板可能没有此代码。
{% for group in line.groups %}
        <span class="order-list__item-variant">Part of: {{ group.display_title }}</span><br/>
    {% endfor %}
  1. 将整个 {% for group in line.groups %} 循环替换为以下代码:
{% if expand_bundles %}
            {% for component in line.bundle_components %}
                <table>
                <tr class="order-list__item">
                    <td class="order-list__bundle-item">
                    <table>
                        <td class="order-list__image-cell">
                        {% if component.image %}
                            <img src="{{ component | img_url: 'compact_cropped' }}" align="left" width="40" height="40" class="order-list__product-image small"/>
                        {% elsif component.image_url %}
                            <img src="{{ component.image_url }}" align="left" width="40" height="40" class="order-list__product-image small"/>
                        {% else %}
                            <div class="order-list__no-image-cell small">
                            <img src="{{ 'notifications/no-image.png' | shopify_asset_url }}" align="left" width="40" height="40" class="order-list__no-product-image small"/>
                            </div>
                        {% endif %}
                        </td>

&#x3C;td class=&#x22;order-list__product-description-cell&#x22;&#x3E;
                    {% if component.product.title %}
                        {% assign component_title = component.product.title %}
                    {% else %}
                        {% assign component_title = component.title %}
                    {% endif %}

                    {% assign component_display = component.quantity %}

                    &#x3C;span class=&#x22;order-list__item-title&#x22;&#x3E;{{ component_title }}&#x26;nbsp;&#x26;times;&#x26;nbsp;{{ component_display }}&#x3C;/span&#x3E;&#x3C;br&#x3E;

                    {% if component.variant.title != &#x27;Default Title&#x27;%}
                        &#x3C;span class=&#x22;order-list__item-variant&#x22;&#x3E;{{ component.variant.title }}&#x3C;/span&#x3E;
                    {% endif %}
                    &#x3C;/td&#x3E;
                &#x3C;/table&#x3E;
                &#x3C;/td&#x3E;
            &#x3C;/tr&#x3E;
            &#x3C;/table&#x3E;
        {% endfor %}
        {% else %}
        {% for group in line.groups %}
            &#x3C;span class=&#x22;order-list__item-variant&#x22;&#x3E;Part of: {{ group.display_title }}&#x3C;/span&#x3E;&#x3C;br/&#x3E;
        {% endfor %}
    {% endif %}</code></pre></figure><ol start="16">
  • Click Save.
  • 通过编辑工作流来更新弃购或弃单电子邮件

    如果您设置了弃单自动化,则可以通过编辑现有的挽回弃单电子邮件模板来更新弃单电子邮件,以显示产品套装的分组视图。

    步骤:

    台式电脑
    1. 在您的 Shopify 后台中,转到应用 > Messaging

    2. 点击自动化

    3. 点击您要编辑的营销流程。

    4. 点击编辑

    5. 点击关闭自动化

    6. 在对话框中,点击关闭

    7. 点击编辑

    8. 在流程自动化中,点击发送营销电子邮件

    9. 点击编辑电子邮件

    10. 编辑此电子邮件会将其恢复为草稿对话框中,点击继续

    11. 对您的电子邮件模板进行以下任一编辑:

    • 主题行中添加主题
    • 向模板中添加任何其他文本或分区
    1. 可选:若要查看您的电子邮件,请点击发送测试邮件,然后输入您希望接收该电子邮件的电子邮件地址。在您的收件箱中,打开并查看该电子邮件。
    2. 点击设为有效
    3. 点击开启自动化
    移动设备
    1. Shopify 应用中,轻触 菜单 图标。

    2. 应用部分中,轻触 Messaging

    3. 轻触 Messaging > 自动化

    4. 对于要编辑的营销工作流程,轻触 水平菜单 > 关闭

    5. 在对话框中,轻触停用

    6. 轻触该营销工作流。

    7. 在营销电子邮件旁边,轻触 水平菜单 > 编辑

    8. “编辑此电子邮件会将其还原为草稿”对话框中,轻触“继续”

    9. 主题行中添加主题,然后对您的模板进行任何其他文本或分区更改。

    10. 可选:若要查看您的电子邮件,请轻触发送测试邮件,然后输入您要接收该电子邮件的邮箱地址。在您的收件箱中,打开该电子邮件并进行查看。

    11. 轻触设为活跃

    12. 轻触 水平菜单垂直菜单 > 开启自动化

    从营销自动化摘要页面更新弃购或弃单电子邮件

    如果您已设置弃单自动化,则可以通过编辑弃购弃单分区来更新弃单营销邮件,以显示产品套装的分组视图。

    步骤:

    台式电脑
    1. 在您的 Shopify 后台中,转到应用 > Messaging

    2. 点击自动化

    3. 点击您要编辑的营销流程。

    4. 活动名称部分,点击您要编辑的模板的缩略图。

    5. 点击编辑

    6. 编辑此电子邮件会将其恢复为草稿对话框中,点击继续

    7. 点击模板的弃单弃购分区旁边的垃圾桶图标。

    8. 点击 + 添加分区

    9. 点击弃购弃单分区。

    10. 可选:若要查看您的电子邮件,请轻触发送测试邮件,然后输入您要接收该电子邮件的邮箱地址。在您的收件箱中,打开该电子邮件并进行查看。

    11. 点击设为有效

    移动设备
    1. Shopify 应用中,轻触 菜单 图标。

    2. 应用部分中,轻触 Messaging

    3. 轻触 Messaging > 自动化

    4. 对于要编辑的营销工作流程,轻触 水平菜单 > 关闭

    5. 轻触该营销工作流。

    6. 轻触您要编辑的模板的缩略图。

    7. 轻触编辑

    8. “编辑此电子邮件会将其还原为草稿”对话框中,轻触“继续”

    9. 向上轻扫以编辑模板。

    10. 长按弃单弃购分区,然后轻触垃圾桶图标。

    11. 轻触 + 按钮,然后轻触弃购弃单分区。

    12. 可选:若要查看您的电子邮件,请轻触发送测试邮件,然后输入您要接收该电子邮件的邮箱地址。在您的收件箱中,打开该电子邮件并进行查看。

    13. 轻触设为活跃