Overriding the product search box (widget)

For tips on how to override this function, see: Template Structure + Overriding Templates via a Theme.

The product search box widget loads the search box using the template function:

get_product_search_form()

For more info, see: Function get_product_search_form.

It then looks for the product search form in the file ‘product-searchform.php’ or uses its default markup. You can override the default WooCommerce template product-searchform.php by customizing the markup.

For reference, the default markup is:

The form is also run through the filter get_product_search_form.

WooCommerce - the most customizable eCommerce platform for building your online business.

Back to the top