如果循环不起作用,则小于条件 - Liquid HTML

时间:2016-01-19 05:29:28

标签: shopify liquid

在液体html中,大于条件的效果在if循环

中效果很好
{% assign var1 = product.extended_attributes.inventory | plus: 0 %}
  {% if var1 > 5 %}
    test text
  {% endif %}

这种情况有效。但我想检查不到条件

{% assign var1 = product.extended_attributes.inventory | plus: 0 %}
 {% if var1 < 5 %}
   test text
 {% endif %}

此代码打破了<中的液体html语法,因此这种情况无效。

注意:这发生在blueshift电子邮件模板上。不确定其他人。

1 个答案:

答案 0 :(得分:0)

这可能是应用程序特定的错误。试试这个

{% assign var1 = product.extended_attributes.inventory | plus: 0 %}
 {% unless var1 >= 5 %}
   test text
 {% endunless %}