title: Query by product category, product tags and price in Woocommerce
body: <p>I am trying to make a simple form to query woocommerce products wine based on form input fields as follows:</p>
  
  <ul>
  <li><p>Selected category (Vine type, eg. red wine, white wine etc..) - Input type dropdown</p></li>
  <li><p>Select Winery Tag 1 dropdown</p></li>
  <li><p>Select Wine Sort Tag 2 dropdown</p></li>
  <li><p>Select wine region Tag 3 dropdown</p></li>
  <li><p>Price Range dropdown</p></li>
  </ul>
  
  <p>Filtering by category and price works, however tags give mixed results and i cannot figure out why.</p>
  
  <p>This is how my form looks like to give some context:</p>
  
  <p><a href="https://i.stack.imgur.com/JdZ2x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JdZ2x.png" alt="enter image description here"></a></p>
  
  <p>Here is my code:</p>
  
  <pre><code>$custom_query_args = array(
        'post_type'               =&gt; 'product',
        'post_status'             =&gt; 'publish',
        'ignore_sticky_posts' =&gt; 1,
        'order'               =&gt; 'DESC',
        'posts_per_page'      =&gt; 3,
        'product_tag'           =&gt; array($tag1, $tag2, tag3), 
        'tax_query'           =&gt; array(
               array(
                 'taxonomy'       =&gt; 'product_cat',
                 'terms'      =&gt; array( esc_attr( $category ) ),
                 'field'      =&gt; 'slug',
                 'operator'       =&gt; 'OR'                            
                        )),
                  //Price
                  'meta_query' =&gt; array(
                      array(
                          'key' =&gt; '_price',
                          'value' =&gt; array($clow, $chigh),
                          'compare' =&gt; 'BETWEEN',
                          'type' =&gt; 'NUMERIC'
                      )
                )
          );
  </code></pre>
  
  <p>From the input fields, I have 3 variables for product tags (like <code>$tag1</code>, <code>$tag2</code>, <code>$tag3</code>), 1 variable for product category (like <code>$category</code>) and 2 variables for the price range (like <code>$clow</code> and <code>$chigh</code>) which are the price from to.</p>
  
  <p>Anyone have an idea why this happens?</p>