title: Show stock status next to each attribute value in WooCommerce variable products
body: <p>I want to implement in my store something similar like this:</p>
  
  <p><a href="https://i.stack.imgur.com/lqVCa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lqVCa.png" alt="enter image description here"></a></p>
  
  <p>I have this code, but this show quantity next to each variation.</p>
  
  <pre><code>function get_stock_variations_from_product(){
  global $product;
  $variations = $product-&gt;get_available_variations();
  foreach($variations as $variation){
       $variation_id = $variation['variation_id'];
       $variation_obj = new WC_Product_variation($variation_id);
       $stock = $variation_obj-&gt;get_stock_quantity();
  }
  }
  </code></pre>
  
  <p>And also this code:</p>
  
  <pre><code>  global $product;
  $product_variations = $product-&gt;get_available_variations();
  
  foreach ($product_variations as $variation)  {
      $var_data = $variation['attributes'];
      $var_data['in_stock'] = $variation['is_in_stock'];
  }
  
  //List all attributes with stock available or not array..
  echo '&lt;pre&gt;';
  print_r($var_data);
  echo '&lt;/pre&gt;';
  die;
  </code></pre>
  
  <p>How can I customize the variable products to show stock Status next to each attribute values? </p>
  
  <p>Thanks</p>