套装分组视图电子邮件通知模板更新
自 2024 年 12 月 6 日起,包含套装的订单现在将在您的许多电子邮件模板中显示为嵌套的订单项目组。
任何使用默认模板的通知模板都已自动更新,以显示产品套装的分组视图。如果您在 2024 年 12 月 6 日之前自定义了任何电子邮件通知模板,则您的通知模板不会更新。要将通知模板更新为套装视图,您可以使用以下方法:
- 对于 设置 > 通知 部分中的所有通知,您可以使用以下任一方法:
- 对于使用 Shopify Messaging 的弃单自动化,您可以编辑自动化中的现有模板以将其还原。
在此页面上
更新自定义电子邮件模板的注意事项
对电子邮件通知模板进行任何更改之前,请查看以下注意事项:
- Shopify 后台中设置 > 通知 部分的通知模板包含 Liquid(Shopify 的模板语言)、HTML 和 CSS。只有在您了解 HTML 和 CSS 并对 Liquid 有基本了解的情况下,才能编辑通知模板的代码。
- 保存对通知模板的更改会覆盖以前的模板代码。您可以将模板还原为默认模板,但如果这样做,您之前对模板代码的自定义内容将会丢失且无法恢复。
- 如果您想更新模板,但没有编辑通知模板代码的经验,则可以寻求帮助:
- Shopify 支持团队无法为您大幅编辑通知模板,但在 Shopify 设计政策的权限范围内,也许能够帮助您对免费的 Shopify 模板进行细微调整。
- 如需进行较复杂的更改,请聘请 Shopify 合作伙伴。
分组视图更改前后对比
在更新电子邮件通知模板之前,产品套装显示为单独的订单项目:

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

已针对产品套装更新的电子邮件通知列表
以下通知模板会显示产品套装的分组视图或平铺视图。
客户通知
| 通知模板 | 后台位置 | 显示类型 |
|---|---|---|
| 订单确认 | 订单处理 | 套装显示为嵌套组。 |
| 订单发票 | 订单异常 | 套装显示为嵌套组。 |
| 待处理的付款错误 | 付款 | 套装显示为嵌套组。 |
| 待处理的付款成功 | 付款 | 套装显示为嵌套组。 |
| 发送给客户的 POS 电子邮件 | POS | 套装显示为嵌套组。 |
| POS 和移动设备收据 | POS | 套装显示为嵌套组。 |
| 已创建退货 | 退货 | 套装中的每件产品都显示为单独的商品。 |
| 已收到退货请求 | 退货 | 套装中的每件产品都显示为单独的商品。 |
| 退货请求已批准 | 退货 | 套装中的每件产品都显示为单独的商品。 |
| 退货请求已拒绝 | 退货 | 套装中的每件产品都显示为单独的商品。 |
员工通知
| 通知模板 | 显示类型 |
|---|---|
| 新订单 | 套装显示为嵌套组。 |
| 新退货请求 | 套装中的每件产品都显示为单独的商品。 |
| 销售归因已编辑 | 套装中的每件产品都显示为单独的商品。 |
| 新草稿订单 | 套装显示为嵌套组。 |
| 弃单(在 Shopify Messaging 中) | 套装显示为嵌套组。 |
还原自定义通知模板
要更新 Shopify 后台中设置 > 通知 部分的自定义通知模板,您可以手动备份对电子邮件模板的任何自定义内容,将模板还原为默认模板,然后重新应用您的自定义内容。
步骤:
台式电脑
在 Shopify 后台中,转至设置 > 通知。
点击客户通知或员工通知。
点击要更新的通知。
点击编辑代码。
在模板中选中您想保留的自定义内容,复制其代码,然后将其保存在安全的位置(例如文本文件)以备份现有自定义内容。
点击恢复为默认值。恢复后,您的自定义内容将无法恢复,因此请确保您已安全备份所做的更改。
在对话框中,点击恢复更改进行确认。
将您的自定义内容重新应用到更新后的模板。
点击保存。
移动设备
在 Shopify 应用中,轻触
,然后轻触
设置。
在 商店设置部分中,轻触 通知。
轻触客户通知或员工通知。
轻触您要更新的通知。
轻触
按钮以编辑模板代码。
在模板中选中您想保留的自定义内容,复制其代码,然后将其保存在安全的位置(例如文本文件)以备份现有自定义内容。
轻触恢复为默认值。恢复后,您的自定义内容将无法恢复,因此请确保您已安全备份所做的更改。
在对话框中,轻触恢复更改进行确认。
将您的自定义内容重新应用到更新后的模板。
轻触保存或 ✓。
编辑您的自定义电子邮件模板代码
如果您自定义了电子邮件模板的代码,则可以手动更新该代码以支持产品套装的分组视图。每个模板的默认代码各不相同。若要在 Shopify 后台的设置 > 通知部分中更新自定义的通知模板,请按照您需要编辑的每个模板的说明进行操作。
更新订单电子邮件通知
请按照以下步骤更新以下订单电子邮件通知的自定义模板:
- 订单确认
- 新订单电子邮件
- 订单发票
- 待处理的付款成功
- 待处理的付款错误
- POS 和移动设备收据
步骤:
在 Shopify 后台中,转至设置 > 通知。
点击客户通知或员工通知。
点击要更新的通知。
点击编辑代码。
在模板中选中您想保留的自定义内容,复制其代码,然后将其保存在安全的位置(例如文本文件),以备份您现有的自定义内容。您也可以选中整个模板,将其复制并保存在安全位置。
通过搜索
subtotal_line_items,在模板中查找订单项目循环。它将显示如下内容:
{% for line in subtotal_line_items %}- 通过在开始的
subtotal_line_items循环正下方添加{% if line.groups.size == 0 %},将subtotal_line_items循环内的所有代码包裹在 if 条件中,然后通过在结束的{% endfor %}循环正上方添加{% endif %}来闭合 if 条件。
{% if line.groups.size == 0 %}
<Your old code>
{% endif %}- 您的代码应如下所示:
{% for line in subtotal_line_items %}
{% if line.groups.size == 0 %}
<Your old code>
{% endif %}
{% endfor %}- 将以下代码粘贴到
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 }} × {{ 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 }} × {{ 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>- 点击保存。
更新草稿订单和弃单电子邮件通知
请按照以下步骤更新以下电子邮件通知的自定义模板:
- 新草稿订单
- 弃购
- 草稿订单发票
- 发送给客户的 POS 电子邮件
步骤:
台式电脑
在 Shopify 后台中,转至设置 > 通知。
点击客户通知或员工通知。
点击要更新的通知。
点击编辑代码。
在模板中选中您想保留的自定义内容,复制其代码,然后将其保存在安全的位置(例如文本文件)以备份现有自定义内容。
通过搜索
subtotal_line_items,在模板中查找订单项目循环。它将显示如下内容:
{% for line in subtotal_line_items %}- 将以下代码粘贴在
{% for line in subtotal_line_items %}开始循环的正后方:
{% assign expand_bundles = true %}- 查找用于呈现产品图片的代码块。它应如下所示:
<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>- 请修改
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>- 查找用于呈现多属性标题的代码。它应如下所示:
{% if line.variant.title != 'Default Title' %}
<span class="order-list__item-variant">{{ line.variant.title }}</span><br/>
{% endif %}- 要隐藏产品套装的多属性标题,请将
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 %}- 可选:查找用于呈现价格的代码。它应具有
order-list__price-cell类。弃购电子邮件通知中没有此代码,但草稿订单通知模板中有。它应如下所示:
<td class="order-list__price-cell">- 为价格添加 if 语句和附加类以更新主套装的价格。它应如下所示:
<td
{% if expand_bundles and line.bundle_parent? %}
class="order-list__parent-price-cell"
{% else %}
class="order-list__price-cell"
{% endif %}
>- 在
{% for group in line.groups %}for 循环中搜索flat view或Part of:代码。旧电子邮件模板可能没有此代码。
{% for group in line.groups %}
<span class="order-list__item-variant">Part of: {{ group.display_title }}</span><br/>
{% endfor %}- 将整个
{% 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>
<td class="order-list__product-description-cell">
{% if component.product.title %}
{% assign component_title = component.product.title %}
{% else %}
{% assign component_title = component.title %}
{% endif %}
{% assign component_display = component.quantity %}
<span class="order-list__item-title">{{ component_title }}&nbsp;&times;&nbsp;{{ component_display }}</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 %}
{% else %}
{% for group in line.groups %}
<span class="order-list__item-variant">Part of: {{ group.display_title }}</span><br/>
{% endfor %}
{% endif %}</code></pre></figure><ol start="16">
Click Save.
通过编辑工作流来更新弃购或弃单电子邮件
如果您设置了弃单自动化,则可以通过编辑现有的挽回弃单电子邮件模板来更新弃单电子邮件,以显示产品套装的分组视图。
步骤:
台式电脑
在您的 Shopify 后台中,转到应用 > Messaging。
点击自动化。
点击您要编辑的营销流程。
点击编辑。
点击关闭自动化。
在对话框中,点击关闭。
点击编辑。
在流程自动化中,点击发送营销电子邮件。
点击编辑电子邮件。
在编辑此电子邮件会将其恢复为草稿对话框中,点击继续。
对您的电子邮件模板进行以下任一编辑:
- 在主题行中添加主题
- 向模板中添加任何其他文本或分区
- 可选:若要查看您的电子邮件,请点击发送测试邮件,然后输入您希望接收该电子邮件的电子邮件地址。在您的收件箱中,打开并查看该电子邮件。
- 点击设为有效。
- 点击开启自动化。
移动设备
在 Shopify 应用中,轻触
图标。
在应用部分中,轻触 Messaging。
轻触 Messaging > 自动化。
对于要编辑的营销工作流程,轻触
> 关闭。
在对话框中,轻触停用。
轻触该营销工作流。
在营销电子邮件旁边,轻触
> 编辑。
在“编辑此电子邮件会将其还原为草稿”对话框中,轻触“继续”。
在主题行中添加主题,然后对您的模板进行任何其他文本或分区更改。
可选:若要查看您的电子邮件,请轻触发送测试邮件,然后输入您要接收该电子邮件的邮箱地址。在您的收件箱中,打开该电子邮件并进行查看。
轻触设为活跃。
轻触
或
> 开启自动化。
从营销自动化摘要页面更新弃购或弃单电子邮件
如果您已设置弃单自动化,则可以通过编辑弃购或弃单分区来更新弃单营销邮件,以显示产品套装的分组视图。
步骤:
台式电脑
移动设备
在 Shopify 应用中,轻触
图标。
在应用部分中,轻触 Messaging。
轻触 Messaging > 自动化。
对于要编辑的营销工作流程,轻触
> 关闭。
轻触该营销工作流。
轻触您要编辑的模板的缩略图。
轻触编辑。
在“编辑此电子邮件会将其还原为草稿”对话框中,轻触“继续”。
向上轻扫以编辑模板。
长按弃单或弃购分区,然后轻触垃圾桶图标。
轻触 + 按钮,然后轻触弃购或弃单分区。
可选:若要查看您的电子邮件,请轻触发送测试邮件,然后输入您要接收该电子邮件的邮箱地址。在您的收件箱中,打开该电子邮件并进行查看。
轻触设为活跃。