How to add a search box to a specific page that only searches on that page?

Highlighted
New Member
1 0 0

Hello!

I'm using the Debut Theme and I want to add a search box on the collection page so that people can search the different collections by name.

Hope anyone can help me  

Thanks in advance!

0 Likes
Highlighted
Shopify Partner
1427 193 476

All Shopify stores have a page you can go to view all collections:

www.your-store.myshopify.com/collections

This will list all of your collections, paginated by default. To style that you will probably have to create the template in liquid by going to Online Store > Themes > Actions >Edit Code > Templates > Add New Template -- and click list-collections from the dropdown after Create a New Template For:

I do not know of any way to search for collections. One thing I can think of is to remove the pagination, assuming you have less than 50 collections, this will display all of them up to 50. Then you'd have to write custom javascript that would loop through all of those collecitons, search for matching criteria, and then reload the page with AJAX. How you would do that? Not really sure, but it may be possible this way.

If my solution helped you, please like and accept as solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes