2015-04-30 83 views
0

我想在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> 

回答

0

您正在使用=,但它應該是==See here

我想你也想discount.code你有discount.first.code

嘗試更換這行:

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

與此:

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

我使用的代碼{%如果discount.code == 「DISCODE-2015」 %}它仍然給嘗試我錯誤「液體錯誤:未知的操作員=」 – vimalmichael

+0

@ user3286560我剛剛測試了您提供的代碼,並提供了我建議的更改,並且它在訂單確認電子郵件模板中正常工作。也許錯誤是由別的東西引起的。 –