If you wish to display certain search results on your store, as opposed to all which is the default, you will have to specify so in the code.

Possible scenario, one which we encounter the most, is that the clients do not want to display blog posts when search is used, but only products.

Depending on the theme you use, the part of code you need will be located within the search.liquid or possibly theme.liquid as well.

So, you will go to Themes – Edit code – then open search or theme.liquid (most likely one of these, but it may vary) and find the opening <form> tag (it will have¬†action=”/search”).

Somewhere within the <form></form> you will put the following code to display only products in search results:

<input type="hidden" name="type" value="product">

In the same manner, if you wish to display only pages or the articles, you will change the value “product” to “page” or “article”.


Write a comment