title: Woocommerce - Getting the order item price and quantity.
body: <p>Using Woocommerce 2.6.8 , I can't get the Order Item Data information as described in the <a href="https://docs.woocommerce.com/wc-apidocs/source-class-WC_Abstract_Order.html#1186-1218" rel="noreferrer">docs</a> and <a href="https://stackoverflow.com/a/39409201/2193349">here on SO</a>.</p>
  
  <p>All I want is to get the Line Item price and Quantity, which should be as simple as:</p>
  
  <pre><code>$order = new WC_Order( $order_id );
  $order_items = $order-&gt;get_items();
   foreach ($order_items as $items_key =&gt; $items_value) {  
             echo $items_value['name']; //this works
             echo $items_value['qty']; //this doesn't work
             echo $items_value[item_meta][_qty][0]; //also doesn't work
             echo $items_value['line_total']; //this doesn't work
     }
  </code></pre>
  
  <p>Looking closer at what gets returned returned</p>
  
  <pre><code>Array
  (
  [1] =&gt; Array
      (
          [name] =&gt; Sample Product 1
          [type] =&gt; line_item
          [item_meta] =&gt; 
          [item_meta_array] =&gt; Array
              (
                  [1] =&gt; stdClass Object
                      (
                          [key] =&gt; _qty
                          [value] =&gt; 1
                      )
  
                  [2] =&gt; stdClass Object
                      (
                          [key] =&gt; _tax_class
                          [value] =&gt; 
                      )
  
                  [3] =&gt; stdClass Object
                      (
                          [key] =&gt; _product_id
                          [value] =&gt; 8
                      )
  
                  [4] =&gt; stdClass Object
                      (
                          [key] =&gt; _variation_id
                          [value] =&gt; 0
                      )
  
                  [5] =&gt; stdClass Object
                      (
                          [key] =&gt; _line_subtotal
                          [value] =&gt; 50
                      )
  
                  [6] =&gt; stdClass Object
                      (
                          [key] =&gt; _line_total
                          [value] =&gt; 50
                      )
  
                  [7] =&gt; stdClass Object
                      (
                          [key] =&gt; _line_subtotal_tax
                          [value] =&gt; 0
                      )
  
                  [8] =&gt; stdClass Object
                      (
                          [key] =&gt; _line_tax
                          [value] =&gt; 0
                      )
  
                  [9] =&gt; stdClass Object
                      (
                          [key] =&gt; _line_tax_data
                          [value] =&gt; a:2:{s:5:"total";a:0:{}s:8:"subtotal";a:0:{}}
                      )
  
              )
  
      )
  
  )
  </code></pre>
  
  <p>This is all using documented Woocommerce methods, why is the information I need stored in this <code>item_meta_array</code>? </p>
  
  <p>Does anyone know how I can get that information? </p>
  
  <p>Preferably using documented methods as opposed to a crude hack of looping through the <code>item_meta_array</code> until I find the key I'm looking for.</p>
  
  <p>I feel like I must be missing something obvious here.</p>