By default, when visitors use the Search option on your website, the results will show posts, pages, products, etc. that fit the term searched.
If you』re running an online store, you might want to limit the search only to WooCommece products. This can help users find products faster and increase the conversion rate on your website.
To do this, you would need to add the following filter to the functions.php file of your Child Theme:
add_filter( 'get_search_form', 'astra_get_search_form_callback' );
function astra_get_search_form_callback( $search_form ) {
$search_form = str_replace( '-1">', '-1"/>', $search_form );
return $search_form;
}
If you don』t have your Child Theme installed, please check this article on how to do it.
If you are not sure how to add this code, please check this article.