Great,
We hacked it for our purposes.. it’s pretty ugly, but it works!
if($wpcl_orders) {
$output .= ‘<table class=”ecvbackers”>’;
foreach($wpcl_orders->posts as $wpcl_order) {
$order = new WC_Order($wpcl_order->ID);
$billmail = $order->get_billing_email();
$output .= ‘<tr>’;
$output .= ‘<td class=”ecvavatar”>’ . get_avatar($billmail) . ‘</td>’;
$output .= ‘<td class=”ecvname”>’ . $order->get_billing_first_name() . ‘ ‘ . $order->get_billing_last_name() . ‘</td>’;
//if($customer_atts[‘quantity’] == true) {
if (sizeof($order->get_items())>0) {
$singlecount = ”;
foreach($order->get_items() as $item) {
if( $item[‘product_id’] == $post_id ) {
$productcount[] = $item[‘qty’]; $singlecount+= $item[‘qty’];
}
foreach($item->get_meta_data() as $itemvariation) {
$ecvarkey = wc_attribute_label($itemvariation->key);
$ecvarname = wc_attribute_label($itemvariation->value);
//echo ‘‘ . wc_attribute_label($itemvariation->key) . ‘: ‘ . wc_attribute_label($itemvariation->value) . ‘<br />’;
}
}
$items[‘order-qty’] = $singlecount;
//$output .= ‘<td class=”count”>’ . $singlecount . ‘</td>’;
}
//}
$output .= ‘<td class=”ecvperk”>’ . $ecvarkey . ‘: ‘ . $ecvarname . ‘</td>’;
$output .= ‘<td class=”ecvtotal”>’ . $order->get_formatted_order_total() . ‘</td>’;
$output .= ‘</tr>’;
}
$output .= ‘</table>’;
}