【发布时间】:2021-10-08 12:43:22
【问题描述】:
如何在shopify自定义模板中显示特定标签“有机”的产品?这是我的代码。
{% if customer.tags contains 'organic' %}
<div class="product-list product-list--collection">
{%- for product in collections.all.products limit: product_limit-%}
{% for c in product.collections %}
{% if c.title == collection.title %}
{%- render 'product-item' -%}
{% endif %}
{% endfor %}
{% if collection.handle=="all" %}
{%- render 'product-item' -%}
{% endif %}
{%- endfor -%}
</div>
{% else %}
<div class="product-list product-list--collection
{% if has_filters %}
product-list--with-sidebar
{% endif %}">
{%- for product in collection.products -%}
{%- render 'product-item' -%}
{%- endfor -%}
</div>
{% endif %}
【问题讨论】:
标签: shopify shopify-app shopify-template