manage_shop_order_posts_custom_column From https://wordpress.org/support/topic/add-product-as-column-in-orders-overview
<?php
add_filter( 'manage_edit-shop_order_columns', 'imarcon_set_custom_column_order_columns');
function imarcon_set_custom_column_order_columns($columns) {
// global $woocommerce;
$nieuwearray = array();
foreach($columns as $key => $title) {
if ($key=='billing_address') // in front of the Billing column
$nieuwearray['order_producten'] = __( 'Products', 'woocommerce' );
$nieuwearray[$key] = $title;
}
return $nieuwearray ;
}
add_action( 'manage_shop_order_posts_custom_column' , 'imarcon_custom_shop_order_column', 10, 2 );
function imarcon_custom_shop_order_column( $column ) {
global $post, $woocommerce, $the_order;
switch ( $column ) {
case 'order_producten' :
$terms = $the_order->get_items();
if ( is_array( $terms ) ) {
foreach($terms as $term)
{
echo $term['item_meta']['_qty'][0] .' x ' . $term['name'] .'<br />';
}
} else {
_e( 'Unable get the producten', 'woocommerce' );
}
break;
}
}
?>