title: Get all orders and orderdata of a single customer in WooCommerce by user ID
body: <p>I want to get all order amounts and the payment date of orders made by current user inside a plugin.</p>
  
  <p>I'm using this code, it currently prints order values:
  Like this 150001000
  where 1st order is 0(starting from right) and 2nd is 100 and third is 15000.
  What I am trying to accomplish is putting orders amounts and dates in variables.</p>
  
  <pre><code>$customer = wp_get_current_user();
  // Get all customer orders
  $customer_orders = get_posts( array(
  'numberposts' =&gt; -1,
  'meta_key'    =&gt; '_customer_user',
  'orderby' =&gt; 'date',
  'order' =&gt; 'DESC',
  'meta_value'  =&gt; get_current_user_id(),
  'post_type'   =&gt; wc_get_order_types(),
  'post_status' =&gt; array_keys( wc_get_order_statuses() ),  'post_status' 
  =&gt; array( 'wc-processing'),
  ) );
  
  
  //echo count( $customer_orders );
  foreach ( $customer_orders as $customer_order ) {
  $orderq = wc_get_order( $customer_order );
  $totalq = $orderq-&gt;get_total();
  echo $totalq;       
  } 
  </code></pre>