我不确定我哪里出了问题,但我正在尝试根据其标签过滤集合,使用过滤器更新 url,然后它应该更新显示的产品(这是我遇到问题的地方)
<!-- Product Loop & Pagination -->
{% paginate collections.watches.products by limit %}
<div>
{% if collection.all_tags.size > 0 %}
<ul id="sort-by" class="tag-filters">
{% for tag in collection.all_tags %}
{% if current_tags contains tag %}
<li class="tag-filters__item active">{{ tag | link_to_remove_tag: tag }}</li>
{% else %}
<li class="tag-filters__item">{{ tag | link_to_add_tag: tag }}</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% for product in collections.watches.products %}
{% render 'product-card-grid', product: product, current_variant: product.selected_or_first_available_variant %}
{% endfor %}
{% if paginate.pages > 1 %}
{% include 'pagination' %}
{% endif %}
{% endpaginate %}
标签按预期显示为过滤器,当您单击标签过滤器时,它会更新定制程序界面中的 url,例如 - %2Ffilter_style-men%2Bmen