Shopify产品数据

时间:2017-09-18 23:14:33

标签: shopify liquid

我正在尝试将产品网址和图片添加到滑块内的div。但是,我将产品下拉列表添加到架构中,但它没有将数据提取到div。请找到以下架构:

{% schema %}
{
"name": "Product-Slideshow",
  "settings": [
{
  "id": "text-box",
  "type": "text",
  "label": "Heading",
  "default": "Title"
}
],
"blocks": [
{
  "type": "select",
  "name": "Add Product",
  "settings": [
    {
    "type":      "product",
    "id":        "id",
    "url":       "url",
    "label":     "text",
    "info":      "text"
    },
  ]
}
],
"presets": [
{
  "name": "Product-Slideshow",
  "category": "Image",
  "blocks": [
    { 
      "type": "select"
    },
    {
      "type": "select"
    }
  ]
 }
]
}
{% endschema %}

这是放置它的div。

<div class="owl-carousel">
{% for block in section.blocks %}  
<div><a href="{{ product.url }}" class="btn"><img src="{{ image.src | 
product_img_url }}"></a></div> 
{% endfor %}
</div>

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:1)

您必须按照此处的说明调用您的阻止设置: https://help.shopify.com/themes/liquid/objects/block#block-settings

例如{{block.settings.image}}

之类的东西