I want to use WP_Query to find all product terms entered in the input field. Here is my WP_Query code.
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $args = array( 'post_type' => 'product', 'product_cat' => 'construction', 'posts_per_page' => 12, 'paged' => $paged, 'tax_query' => array( array( 'taxonomy' => 'pa_reference-p-no', 'field' => 'slug', 'terms' => $input_search_txt ) ); ); $loop = new WP_Query( $args );
'$input_search_txt' is the text entered in the input field. I want to find all products that contain this text in 'pa_reference-p-no'. For example, if I search for '123', I want to find products with terms '12345' or '123456'.
But now I can only see the product with the term '123'.
I want someone to help me.