Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

search woocommerce product exlude prodictids and include terms

// WP_Query arguments
$args = array(
	'post_type'              => array( 'product' ),
	'post_status'            => array( 'publish' ),
	's'                      => 'test',
	'nopaging'               => true,
	'posts_per_page'         => '20',
	'order'                  => 'DESC',
	'orderby'                => 'title',
);

// The Query
$query = new WP_Query( $args );