Product Search in Navigation

How would I go about making the search function in the main navigation display results like it does when using the WooCommerce Product search widget. Basically it looks like in the url, the only difference is for the woocommerce product layout where the string &post_type=product is added at the end.

Website is an adult store - www.dejavuloveboutique.com

1 Like

Hi There,

Please add the following code under Customizer > Custom > Global Javascript:

jQuery('.x-searchform-overlay form').append('<input type="hidden" value="product" name="post_type" />');
2 Likes

Perfect thank you so much!! What about doing the same thing for the Search Modal in the Pro Headers?

Hi,

For PRO, you can try this code.

jQuery('.x-search').append('<input type="hidden" value="product" name="post_type" />');

Hope that helps.

Perfect!! Thank you!!

Glad we could help :slight_smile:

Cheers!

Thank you!

You’re welcome.

I did something similar by adding the widget “Product Search” to the main (Uber) menu. Now I have a product search box in the menu navbar that is “sticky”.

Thanks for sharing @iraznatovic!