title: Get and Pass Order items and Order details in Woocommerce 3
body: <p>We need pass these following WooCommerce parameters but we can't and have got errors.</p>
  
  <ul>
  <li>Unique Order ID</li>
  <li>Product SKUs purchased</li>
  <li>Quantity of each product purchased</li>
  <li>Price of each product purchased</li>
  <li>Currency of the transaction</li>
  <li>Discount Amount (whole-order and item-specific)</li>
  <li>Coupon Code used</li>
  </ul>
  
  <p>the main issues are getting all products Quantities, Quantity of each product purchased, Product SKU</p>
  
  <p>Here is our code:</p>
  
  <pre><code>add_action( 'woocommerce_thankyou', 'the_tracking' );
  
  function the_tracking( $order_id ) {
  
      global  $woocommerce;
  
      $order = wc_get_order( $order_id );
      $total = $order-&gt;get_total();
      $currency = get_woocommerce_currency();
      $subtotal = $woocommerce-&gt;cart-&gt;subtotal;
      $coupons = $order-&gt;get_used_coupons();
      $coupon_code = '';
      $discount = $order-&gt;get_total_discount();
      foreach ($coupons as $coupon){
          $coupon_code = $coupon;
      }
      $tracking = 'OrderID='.$order.'&amp;ITEMx=[ItemSku]&amp;AMTx=[AmountofItem]&amp;QTYx=[Quantity]&amp;CID=1529328&amp;OID=[OID]&amp;TYPE=385769&amp;AMOUNT='. $total .'&amp;DISCOUNT='. $discount .'&amp;CURRENCY='. $currency .'&amp;COUPON='. $coupon_code .'';
      echo $tracking;
   }
  </code></pre>
  
  <p>But it doesn't give us the expected results as we should need.</p>
  
  <p>Any help is appreciated.</p>