title: Get Woocommerce products by custom taxonomy term values in a WP_Query
body: <p>I'm developing a plugin that will be placed in my woocommerce product sidebar.
  I need that, given the product id/object, it will find 2 product with the same custom taxonomy I created before.</p>
  
  <p>With this code I got the list of terms used in my product where <strong>"collane" is the custom taxonomy</strong>:</p>
  
  <pre><code>get_the_term_list( $product-&gt;id, 'collane', '&lt;div style="direction:rtl;"&gt;', '&lt;/div&gt;', '' ); 
  </code></pre>
  
  <p>The problem is that I don't know how to get the custom taxonomy id, and how to filter it by my custom taxonomy.</p>
  
  <p>I've already used WP_Query to find products in the same category with this code:</p>
  
  <pre><code>$args = array(
  'post_type'             =&gt; 'product',
  'post_status'           =&gt; 'publish',
  'ignore_sticky_posts'   =&gt; 1,
  'posts_per_page'        =&gt; $atts['limit'],
  'tax_query'             =&gt; array(
      array(
          'taxonomy'      =&gt; 'product_cat',
          'field' =&gt; 'term_id', //This is optional, as it defaults to 'term_id'
          'terms'         =&gt; $cat_id,
          'operator'      =&gt; 'IN' // Possible values are 'IN', 'NOT IN', 'AND'.
      ),
      array(
          'taxonomy'      =&gt; 'product_visibility',
          'field'         =&gt; 'slug',
          'terms'         =&gt; 'exclude-from-catalog', // Possibly 'exclude-from-search' too
          'operator'      =&gt; 'NOT IN'
      )
  )
  );
  </code></pre>
  
  <p>How can I change my code to obtain the wanted taxonomy id/object, and then use it in my WP_Query? </p>