How can I add a secondary search box for specific items?

Hi All,

I am about to add approx 2000 new items to my shop but I would like these to be hidden from the main search bar and only have them searchable from a secondary search box placed on a landing page.

Does anyone have any pointers on how I might go about this?

1 Like

Hello!

First thing you need to do is find the classes those search boxes belong to. (css)

Then find which sections those belong to.

They’re probably nested in like this:

//start

search bar

more stuff

//end

What you’re trying to do is move the {search bar} from inside that nest to somewhere else.

This link will describe perfectly how to go about problems like these.

https://www.youtube.com/watch?v=jzhsYMxUp8s

good luck.

In think either you’ve misunderstood my question, or I’ve misunderstood your answer as it doesn’t seem to make sense?

I’m after two separate search boxes that only search within the product collections that I want it to..

EG

Search box 1 returns results from collections 1,3,5,7,9
Search box 2 returns results from collections 2,4,6,8

Does that make sense? Or have I missed something?

I think I might’ve misunderstood.

So you’re probably dealing with search filters.

This will help you with that.

https://help.shopify.com/en/manual/products/searching-filtering

To make the boxes return 2 different solutions might require playing with the source or the theme customizer. (There might be an option for this in there but if there isn’t, you can add one if you make a custom section for your searchbar. My first posted link eventually explains adding custom sections. It’s a useful skill to learn to add useful features.)

I hope this helps.

The search filters is only for searching within the admin panel.

I’m talking about on the customer side.

To work with the customer side, you’ll need to edit code for your theme.

I’m sorry I didn’t respond sooner.

The same filtering can be done using the shopify API in pretty much the same way. (editing the theme code)

See this → (with examples.) https://shopify.dev/docs/themes/liquid/reference/objects/product

If you’re a developer, or have someone dealing with the programming aspect, this would help you out. If you’d like to have a development team help you set this up, please feel free to reach out.