How can I filter search results by collection on my e-commerce website?

How can I filter search results by collection on my e-commerce website?

Ultipower
New Member
6 0 0

We are using the code below to display the search result at our Shopify website, but the search results contain wider results than we expect. For example, if we want to search 'light' at the search bar, it will return all products with 'light' in their title or description or collection type, but we want it only to return the result that matches the keyword with the product's collection(e.g., street light). Can anyone please help with this issue?

 

<div class="product-list product-list--collection">
{%- for product in search.results -%}
{%- render 'product-item', product: product, list: show_as_list, grid_classes: grid_classes -%}
{%- endfor -%}
</div>

 

Thanks in advance for any help.

Replies 2 (2)

UkrForever
Shopify Partner
14 0 0

As far as I know, Shopify does not have filters for the search page. You may want to use an app for this one. You can try this advanced filter app for this purpose https://apps.shopify.com/ultimate-search-and-filter-1