title: Get all the product variations for specific product attributes values in Woocommerce
body: <p>In WooCommerce<code>*(latest version)* I have one</code>variable<code>product with</code>Id: 9`.<br />
  With the attributes for variation below I created multiple product variations.</p>
  
  <p>Then I wanna get an specific product variation, from the parent product id (<code>Id: 9</code>) and the following attribute values:</p>
  
  <pre><code>&lt;attribute_for_variation&gt;: &lt;attribute_value_to_filter&gt;
  pa_size: size_8x10
  pa_material: mat_luster_photo_paper
  pa_frame: fra_silver_wood
  pa_mat_usage: musa_yes
  </code></pre>
  
  <p>Below you have an screenshot of that variation:</p>
  
  <p><a href="https://i.stack.imgur.com/uMUKB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uMUKB.png" alt="enter image description here"></a></p>
  
  <p>I have tried the following codes with their corresponding results.
  For simplicity, for now, just tried with the <code>pa_frame</code> attribute only.</p>
  
  <p><strong>Try 1:</strong></p>
  
  <pre><code>static function filterVariations() {
      $query = [
          'post_parent' =&gt; 9,
          'post_status' =&gt; 'publish',
          'post_type' =&gt; ['product_variation'],
          'posts_per_page' =&gt; -1,
      ];
      $result = [];
      $wc_query = new \WP_Query($query);
      while ($wc_query-&gt;have_posts()) {
          $wc_query-&gt;next_post();
          $result[] = $wc_query-&gt;post;
      }
      return $result;
  }
  // ---&gt; RESULT: all the variations, that's OK
  </code></pre>
  
  <p><strong>Try 2:</strong></p>
  
  <pre><code>static function filterVariations() {
      $query = [
          'post_parent' =&gt; 9,
          'post_status' =&gt; 'publish',
          'post_type' =&gt; ['product_variation'],
          'posts_per_page' =&gt; -1,
          'tax_query' =&gt; [
              'relation' =&gt; 'AND',
              [
                  'taxonomy' =&gt; 'pa_frame',
                  'field' =&gt; 'slug',
                  'terms' =&gt; [ 'fra_silver_wood' ],
              ],
          ],
      ];
      $result = [];
      $wc_query = new \WP_Query($query);
      while ($wc_query-&gt;have_posts()) {
          $wc_query-&gt;next_post();
          $result[] = $wc_query-&gt;post;
      }
      return $result;
  }
  // ---&gt; RESULT: empty list
  </code></pre>
  
  <p>Any idea on how to return all the variations with specific attribute values?</p>