title: Get WooCommerce Variable Product attribute selected value
body: <p>I have two attributes in my woocommerce single product page that I have added, "Metal" and "Ring Size". They are "variations" such that they are drop down selections on my product page.</p>
  
  <p>I want to be able to on click of my button, I can be able to <strong><em>grab the selected value</em></strong> and put it onto my URL parameter. </p>
  
  <p>I solved everything up to the part where the value that is grabbed isn't correct.</p>
  
  <p>I have so far tried this but it is just giving me a list of this attributes possible values/selections and not the single selected value..</p>
  
  <pre><code>$metal = $product-&gt;get_attribute( 'Metal' );
  
  http://example.com/?metal=18K%20White%20Gold%20|%2018K%20Yellow%20Gold%20|%20Rose%20Gold%20|%20Platinum
  </code></pre>
  
  <p>I just want what I selected on the drop down, something like this:</p>
  
  <pre><code>http://example.com/?metal=Platinum
  </code></pre>