Shopify-在静态分区块中使用产品类型,无法显示值

Shopify-在静态分区块中使用产品类型,无法显示值,shopify,Shopify,我有一个静态部分,其中包含一些区块,允许商家从产品列表中进行选择。我在仪表板中使用了预期的块,但我不知道如何显示每个产品的值 这就是我的模式的样子: { "name": "New Arrivals", "max_blocks": 4, "blocks": [ { "type": "new-arrival", "name": "New Arrival", "settings": [ { "type": "p

我有一个静态部分,其中包含一些区块,允许商家从产品列表中进行选择。我在仪表板中使用了预期的块,但我不知道如何显示每个产品的值

这就是我的模式的样子:

{
  "name": "New Arrivals",
  "max_blocks": 4,
  "blocks": [
    {
      "type": "new-arrival",
      "name": "New Arrival",
      "settings": [
        {
          "type": "product",
          "id": "product",
          "label": "Product"
        }
      ]
    }
  ]
}
以下是我的for循环的简化版本:

{% if section.blocks.size > 0 %}
        {% for block in section.blocks %}
            <!-- Individual product values here -->
        {% endfor %}
    {% endif %}
但在使用这样的产品类型时,必须有不同的方式获取产品信息。

您可以使用:
{%-分配产品=所有产品[block.settings.product]%}


这将从区块中获取您的产品。然后根据需要将
产品
用于其他属性,如
标题
价格
。例如:
{{product.title}

我终于找到了技术支持,这与他们提供的解决方案相同。非常感谢。我想知道,连字符在开始和结束百分比符号上做了什么?没关系,我在这里偶然发现了答案
{{ block.settings.product.title }}