我正在尝试排除具有特定标签的某些产品。我能够在搜索页面上使用 {% unless result.tags contains 'wholesale' %} 排除产品,但搜索标题有问题。我一直在修改的模板使用的是原始标签。有人有什么建议吗?
{% raw %}
{{#if has_results}}
<ul class="header-search__products grid">
{{#each results}}
<li class="grid__cell 1/3--handheld-and-up 1/4--desk">
<div class="product-item product-item--push">
{{#if on_sale}}
<div class="product-item__labels labels"><span class="label label--on-sale">{{@root.on_sale_label}}</span></div>
{{/if}}
<figure class="product-item__image-container">
<a href="{{url}}" class="product-item__link">
<img class="product-item__image " src="{{image}}" alt="{{image_alt}}">
</a>
</figure>
<div class="product-item__info">
<h3 class="product-item__title">
<a href="{{url}}" class="link">{{title}}</a>
</h3>
{{#if on_sale#}}
<span class="product-item__price product-item__price--new" data-money-convertible>{{price}}</span>
<span class="product-item__price product-item__price--old" data-money-convertible>{{compare_at_price}}</span>
{{else}}
<span class="product-item__price product-item__price--new" data-money-convertible>{{price}}</span>
{{/if}}
</div>
</div>
</li>
{{/each}}
</ul>
<a href="{{results_url}}" class="header-search__see-more button button--secondary" data-results-count="{{results_count}}">{{results_label}}</a>
{{else}}
<p class="header-search__no-results h4">{{results_label}}</p>
{{/if}}
{% endraw %}