Html 对产品集合进行多重筛选
我正在尝试为我的收藏创建多个过滤器 例如:在第一个过滤器下拉列表中,客户可以选择惊奇漫画,在第二个列表中,我希望他们只看到惊奇漫画中的角色 我的问题是:Html 对产品集合进行多重筛选,html,css,shopify,liquid,Html,Css,Shopify,Liquid,我正在尝试为我的收藏创建多个过滤器 例如:在第一个过滤器下拉列表中,客户可以选择惊奇漫画,在第二个列表中,我希望他们只看到惊奇漫画中的角色 我的问题是: 要获取第一个下拉列表的值,我需要编写哪些代码 是否可以生成包含标签MARVEL+另一个标签的所有产品的列表 (如果有帮助的话,我使用的是免费主题“风险投资”) 这就是我的代码当前的样子: <div class="collection-sort"> <label for="SortTags" class="colle
<div class="collection-sort">
<label for="SortTags" class="collection-sort__label">Universe</label>
<select name="SortTags" id="SortTags" class="collection-sort__input">
{% if collection.handle %}
<option value="/collections/{{ collection.handle }}">{{ 'collections.sorting.all_of_collection' | t }}</option>
{% elsif collection.current_type %}
<option value="{{ collection.current_type | url_for_type }}">{{ 'collections.sorting.all_of_collection' | t }}</option>
{% elsif collection.current_vendor %}
<option value="{{ collection.current_vendor | url_for_vendor }}">{{ 'collections.sorting.all_of_collection' | t }}</option>
{% endif %}
{% assign tags = 'MARVEL,DC,Games,Movies,TV' | split: ',' %}
var test;
{% for tag in tags%}
<option value="/collections/{% if collection.handle != blank %}{{ collection.handle }}{% else %}all{% endif %}/{{ tag | handleize }}"{% if current_tags contains tag %} selected="selcted"{% endif %}>{{ tag }}</option>
{% endfor %}
</select>
</div>
宇宙
{%if collection.handle%}
{{'collections.sorting.all_of|collection'|t}
{%elsif collection.current_type%}
{{'collections.sorting.all_of|collection'|t}
{%elsif collection.current_vendor%}
{{'collections.sorting.all_of|collection'|t}
{%endif%}
{%assign tags='MARVEL,DC,Games,Movies,TV'| split:','%}
var检验;
{标记%中的标记的%s}
{{tag}}
{%endfor%}
您可以使用+
堆叠标签。例如marvel+dc+漫画
等等。。这将返回只有这3个标签的产品。您有一个对象“current_tags”,它返回当前页面上的所有标记,这样您就可以获得所有标记。这可能会起作用,但产品也有我不想显示的不相关标记。是否可以只显示“DC_Batman”或“MARVEL_Ironman”这样的标签,我必须获得第一个下拉列表中使用的值。还有可能只显示“奇迹”之后的内容吗?