Shopify:在新订单电子邮件模板中显示折扣代码
Shopify: Display discount codes in new order email template
我想在新订单电子邮件通知模板中显示折扣代码,使用此代码:
{% for discount in discounts %}
{{ discount.code }} : {{ discount.savings | money_with_currency }}
{% endfor %}
它显示的是折扣金额而不是折扣码name/title。创建订单时在后台手动输入折扣也返回空白
无论在何处输入折扣代码,即在管理或结帐中,如何显示折扣代码?
在通知中,您可以访问 discount_application 对象,如下所述:
https://shopify.dev/docs/themes/liquid/reference/objects/discount-application
所以(未测试),类似的东西可能会起作用:
{% for discount_application in discount_applications %}
{{ discount_application.title }} : {{ discount_application.value }}
{% endfor %}
HTH
我想在新订单电子邮件通知模板中显示折扣代码,使用此代码:
{% for discount in discounts %}
{{ discount.code }} : {{ discount.savings | money_with_currency }}
{% endfor %}
它显示的是折扣金额而不是折扣码name/title。创建订单时在后台手动输入折扣也返回空白
无论在何处输入折扣代码,即在管理或结帐中,如何显示折扣代码?
在通知中,您可以访问 discount_application 对象,如下所述: https://shopify.dev/docs/themes/liquid/reference/objects/discount-application
所以(未测试),类似的东西可能会起作用:
{% for discount_application in discount_applications %}
{{ discount_application.title }} : {{ discount_application.value }}
{% endfor %}
HTH