0
我想从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' %}
但是,在把这个代码,所以我可以得到只有产品搜索任何文字。
你是对的,但我想这样使用的代码。 –
如果在搜索结果的第2页中发现,如果您使用代码将其过滤出来,则有可能会显示0结果。说了这两个'include'语句之上的代码'{%if item.object_type =='product'%}'。 – HymnZ