Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在下拉菜单中显示所有Shopify产品的标题和图像_Html_Shopify_Liquid - Fatal编程技术网

Html 在下拉菜单中显示所有Shopify产品的标题和图像

Html 在下拉菜单中显示所有Shopify产品的标题和图像,html,shopify,liquid,Html,Shopify,Liquid,我正在为我的商店开发“捆绑”功能,并希望在自定义表单字段中显示我的所有产品 我想有一个下拉菜单显示每个产品的标题和主要图像 我认为代码应该是这样的: 捆绑商品 {collections.products%中的产品的%s} {{product.title}{{product.characterized_image}} {%endfor%} 试试这个 {% for product in collections['all'].products %} <option val

我正在为我的商店开发“捆绑”功能,并希望在自定义表单字段中显示我的所有产品

我想有一个下拉菜单显示每个产品的标题和主要图像

我认为代码应该是这样的:

捆绑商品
{collections.products%中的产品的%s} {{product.title}{{product.characterized_image}} {%endfor%}

试试这个

    {% for product in collections['all'].products %}
      <option value="{{ product.title }}">{{ product.title }}{{ product.featured_image }}</option>
  {% endfor %}
{%用于集合['all']中的产品。产品%}
{{product.title}{{product.characterized_image}}
{%endfor%}

但是请记住,在一个循环中最多只能调用1000项;默认值为50。

我想说,这种类型的自动完成功能是shopify支持的最接近的功能,我可以理解为什么您不应该这样做,因为这个UI不适合选择产品。我有两个下拉列表,当我在一个下拉列表中选择一个产品时,该产品将在第二个下拉列表中被禁用。@Anupamistry您需要在那里应用JavaScript逻辑。