title: Get all ordered item attribute in woocommerce
body: <p>I am creating custom report that following this script. It works fine, but I need to know how to get the all ordered product attributes. </p>
  
  <pre><code>include_once(WC()-&gt;plugin_path().'/includes/admin/reports/class-wc-admin-report.php');
  $wc_report = new WC_Admin_Report();
  
  $sold_products = $wc_report-&gt;get_order_report_data( array(
      'data' =&gt; array(
          '_product_id' =&gt; array(
              'type' =&gt; 'order_item_meta',
              'order_item_type' =&gt; 'line_item',
              'function' =&gt; '',
              'name' =&gt; 'product_id'
          ),
          '_qty' =&gt; array(
              'type' =&gt; 'order_item_meta',
              'order_item_type' =&gt; 'line_item',
              'function' =&gt; 'SUM',
              'name' =&gt; 'quantity'
          ),
          '_line_subtotal' =&gt; array(
              'type' =&gt; 'order_item_meta',
              'order_item_type' =&gt; 'line_item',
              'function' =&gt; 'SUM',
              'name' =&gt; 'gross'
          ),
          '_line_total' =&gt; array(
              'type' =&gt; 'order_item_meta',
              'order_item_type' =&gt; 'line_item',
              'function' =&gt; 'SUM',
              'name' =&gt; 'gross_after_discount'
          )
      ),
      'where' =&gt; array(
          array(
              'key'      =&gt; 'order_items.order_item_name',
              'value'    =&gt; '%shirt%',
              'operator' =&gt; 'LIKE',
          ),
      ),
  
      'group_by'     =&gt; 'order_item_name',
  
      'query_type' =&gt; 'get_results',
  
      'limit' =&gt; 20,
  
      'order_status' =&gt; array( 'completed', 'processing' ),
  ) );
  
    foreach($sold_products as $product){
        //how to we get the attributes of each sold product? 
    } 
  }
  </code></pre>
  
  <p>I can see attributes are stored in <code>_woocommerce_order_itemmeta</code> table, I can use the 'data' above to get it one by one. But the thing is if some attributes only applied to certain product, which will caused the query above searched no result.  So it would be better to get all of the ordered item attributes at once. </p>