【发布时间】:2014-03-02 04:25:38
【问题描述】:
晚上好!我正在尝试使用纯 Liquid(Shopify 模板语言)从产品的变体数组中删除变体。我只想在万不得已的情况下使用 javascript。
下面是我到目前为止的位置。 if 检查中的任何变体都需要从 currentProduct.variants 中删除。
{% assign currentProduct = product %}
{% for variant in currentProduct.variants %}
{% include 'shappify-variant-is-csp' %}
{% if csp_variant != 1 %}
//need to remove the object that meets this if statement
{% endif %}
{% endfor %}
【问题讨论】: