如何在shopify搜索结果中只显示产品?
How to Display only products in shopify search results?
我只想显示 Shopify 产品中的产品,但也显示页面和帖子,这里是我的搜索结果代码:
<div class="product-list">
{% if grid_results == false %}
{% for item in search.results %}
{% include 'search-result' %}
{% endfor %}
{% else %}
<div class="grid-uniform">
{% for item in search.results %}
{% include 'search-result-grid' %}
{% endfor %}
</div>
{% endif %}
{% endif %}
</div>
现在我得到了以下代码:
{% if item.object_type == 'product' %}
但是把这段代码放在哪里,这样我就可以只获得用于搜索任何文本的产品。
Shopify 为大多数商品提供了出色的自助指南。这是一个这样的
我只想显示 Shopify 产品中的产品,但也显示页面和帖子,这里是我的搜索结果代码:
<div class="product-list">
{% if grid_results == false %}
{% for item in search.results %}
{% include 'search-result' %}
{% endfor %}
{% else %}
<div class="grid-uniform">
{% for item in search.results %}
{% include 'search-result-grid' %}
{% endfor %}
</div>
{% endif %}
{% endif %}
</div>
现在我得到了以下代码:
{% if item.object_type == 'product' %}
但是把这段代码放在哪里,这样我就可以只获得用于搜索任何文本的产品。
Shopify 为大多数商品提供了出色的自助指南。这是一个这样的