我想写一个简单的if语句,但总是很难与shopify的系统.
基本上我希望它这样做:
{%if collection.product =='已停止'%}此产品已停产.{% 万一 %}
如果它在此集合中,则显示此文本/ html.否则它不会显示任何内容.这将在product.liquid模板中.
有任何想法吗?
这就是最终的工作:
{% for c in product.collections %}
{% if c.handle == "discontinued" %}
This product is Discontinued
{% endif %}
{% endfor %}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10845 次 |
| 最近记录: |