title: Woocommerce coupon codes
body: <p>I made the following function to receive the cart total, order_id and coupon codes of an order. The function shows the total amount of the cart and the order id, but does not show the applied coupon codes.</p>
  
  <pre><code>add_action('woocommerce_new_order', 'myfunction');
  
  function myfunction($order_id) {
      global $woocommerce; 
  
      // cart total
          $cart_total = $woocommerce-&gt;cart-&gt;total;
  
      // order id
          $order      = new WC_Order($order_id);
          $order_id   = $order-&gt;get_order_number();
  
      // coupons
          $coupons = '';
          foreach($order-&gt;get_used_coupons() as $coupon) {
              $coupons  .= $coupon;
          }
  }
  </code></pre>
  
  <p>According to the Woocommerce codex example it should work:
  <a href="http://docs.woothemes.com/document/send-coupons-used-in-an-order-by-email/" rel="nofollow">http://docs.woothemes.com/document/send-coupons-used-in-an-order-by-email/</a></p>