Shopify要显示的折扣代码特定消息

时间:2015-04-30 06:48:50

标签: html shopify

我想在shopify电子邮件模板上应用折扣代码特定消息。我尝试了以下代码,它显示了错误 - "液体错误:未知运算符="在我收到的购买邮件中。

<div class="row">
    <div class="left-column">
        {% if discounts %}Discount (code: {{ discounts.first.code }})
    </div>                   

    <div class="right-column">
        {{ discounts_savings | money_with_currency }}
        {% endif %}
    </div>

    <div class="left-column">
        {% for discount in discounts %}
            {% if discount.first.code = "DISCODE-2015" %} 
                Your $50 amazon.com gift card will be send to you soon!
            {% endif %}                   
        {% endfor %}
    </div>
</div>

1 个答案:

答案 0 :(得分:0)

您使用的是=,但应该是==See here

我认为您还希望discount.code discount.first.code。{/ p>

尝试替换此行:

{% if discount.first.code = "DISCODE-2015" %} 

用这个:

{% if discount.code == "DISCODE-2015" %}