title: Retrieve coupon details from coupon code WooCommerce
body: <p>I have previously asked <a href="https://stackoverflow.com/questions/47360869/set-a-coupon-description-in-woocommerce">this question</a> however it does not answer the question of how to retrieve data from a coupon in WooCommerce. Both questions involve coupons, however, the <a href="https://stackoverflow.com/questions/47360869/set-a-coupon-description-in-woocommerce">first question</a> is asking how does one set the metadata and this question asks how you retrieve the data. </p>
  
  <hr>
  
  <p>I am trying to get the details of a coupon from WooCommerce by the coupon code. However, I am not sure on how I should try to go about doing this. </p>
  
  <p>I have tried the code below. However, it gives me the error <code>Call to undefined function WC_Coupon()</code></p>
  
  <pre><code>$coupon_code = 'save10percent';
  global $woocommerce;
  $c = WC_Coupon($coupon_code);
  </code></pre>
  
  <p>How should one go about getting the details of a coupon?</p>