我想将Collection页面中的产品添加到Blog页面中

时间:2017-02-20 03:25:30

标签: shopify

我有一个问题。如何在“博客”页面中导入该集合?

{%- assign collection = collections[section.settings.collection] -%}
{% for product in collection.products limit: product_limit %}
      <div class="grid__item {{ grid_item_width }}">
        {% include 'product-card-grid', grid_image_width: image_size %}
      </div>
    {% endfor %}

我已尝试过上面的代码,但它不起作用。我想要展示产品 https://www.luxilash.com/collections/3dminklashes

1 个答案:

答案 0 :(得分:0)

好吧,我猜你没有为

设置配置
section.settings.collection

在页面模板中。您确定section.settings.collection具有适合您案例的价值吗?

为方便起见,请尝试使用以下代码快照:

{%- assign collection = collections['3dminklashes'] -%}
{% for product in collection.products limit: product_limit %}
      <div class="grid__item {{ grid_item_width }}">
        {% include 'product-card-grid', grid_image_width: image_size %}
      </div>
{% endfor %}

我只是从您提供的网址中抓取了收集代码。

https://www.luxilash.com/collections/3dminklashes