I'm running Woocomerce store with ultimate member plugin. It is used to generate custom user meta (let's call it ID Buyer, stored in wp-usermeta meta-key Id_buyer). 99% of orders are made by registered users that filled Buyer ID field. Now - I was able to display this metadata in wp users column with following code:
function add_custom_column_name($columns) {
$columns['ID_buyer'] = 'ID Buyer:';
return $columns;
}
function show_custom_column_values($value, $column_name, $user_id) {
if ( 'ID_buyer' == $column_name )
return get_user_meta( $user_id, 'Id_buyer', true );
return $value;
}
add_filter('manage_users_columns', 'add_custom_column_name');
add_action('manage_users_custom_column', 'show_custom_column_values', 10, 3);
I want to do the same for woocommerce order list. Making it sortable would be a plus. Is there any way to do it? Please help!