Customize Search Box to only search products

Just wondering if there was an easy way to force the search box in the header to search only in the products of woocommerce. i.e. replace . get_search_form(false) with get_product_search_form(false) if it were the regular wordpress search function.

Or maybe there is another way to force a search to use the woocommerce product archive? ANy ideas?

Thanks

Hey Melanie,

You should be able to by overriding the content-no-results.php file on your child theme. Simply change the get_search_form function there with the new function you want. Give it a shot and let us know how it goes! :slight_smile:

Ben

thanks, I’ll give it a try and let you know how it works.

Sounds like a plan! :slight_smile:

Ben