Skip to content
Advertisement

Merging a general wordpress search with a woocommerce product search?

I am using the following two codes to generate a wordpress search and a woo commerce product search? Is there a code to merge theme into one search bar doing both functions?

JavaScript

Advertisement

Answer

get_search_from(); covers both.
get_product_search_form() is same as get_search_from() just that it restricts the wordpress search to products only.

If you see the markup of both the functions, there’s only one difference. There is an additional post type value set as a product.

JavaScript

So,

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement