title: Get attribute slug value by variation ID in Woocommerce
body: <p>I'm building a custom product page but I have problems with variations</p>
  
  <p>This is my code:</p>
  
  <pre><code>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);
  
       //THIS IS PROBLEM FAIL TEST (It's exemple)
       $type = $variation_obj-&gt;get_attributes()-&gt;get_name();
       //-----
  
       $stock = $variation_obj-&gt;get_stock_quantity();
       $COD = $variation_obj-&gt;get_sku();
       $regularprice = $variation_obj-&gt;get_regular_price();
       $saleprice = $variation_obj-&gt;get_sale_price();
       $diff = $regularprice-$saleprice;
  
       echo "&lt;p&gt;Variation: " .$type."&lt;/p&gt;";
       echo "&lt;p&gt;P.Code: " .$COD."&lt;/p&gt;";
       echo "&lt;p&gt;Regular price: ".$regularprice."&lt;/p&gt;";
       echo "&lt;p&gt;Sale price: ".$saleprice."&lt;/p&gt;";
       echo "&lt;p&gt;Difference: ". $diff."&lt;/p&gt;";
       echo "&lt;p&gt;Stock: ".$stock."&lt;/p&gt;";
  }
  </code></pre>
  
  <p>I am wondering if it is possible to extract the single name of the attribute or variation ?</p>
  
  <p>or the name of the variation without the full title?</p>
  
  <p>example:
  I want "blue"... not "Magic beautiful Pouf Lumaland - blue"</p>
  
  <p>Any kind of help would be much appreciated.</p>