Add search bar that only searches products in a specific collection

Shopify Partner
3 0 0

Add search bar that only searches products in a specific collection.

Is it possible?

0 Likes
Shopify Partner
3 0 0

Finally got it! I THINK. 


<form action="/search" method="get" class="search-bar" role="search">
  <input type="hidden" name="type" value="product">

  <input type="search" name="q" value="{{ search.terms | escape }}" placeholder="Search all products..." aria-label="Search all products">
  <button type="submit" class="search-bar--submit icon-fallback-text">
    <span class="icon icon-search" aria-hidden="true"></span>
    <span class="fallback-text">Search</span>
  </button>
</form>

<form action="/search/collections/your-collection-name-here/" method="get">
<input type="text" name="q" />
<input type="submit" value="Search" />
</form>

 

Enter your collection name as appears with - inbetween words

0 Likes
Excursionist
52 0 5

i tried this, and looking at your site, im guessing this doesnt work for you either?

1 Like
Highlighted
Shopify Partner
6 0 2

This doesn't work. 

1 Like