1
votes

I am trying to add mycustomfield21 (added to checkout with woo checkout manager) on bulk order details on woocommerce dashboard. Here is a screenshot to show what I need:

enter image description here

EDITED QUESTION

I already instert 2 fields, wich are first name (myfield21) and surname (myfield22), How can I do to display a white space between them? because it shows like "first namesurname"

1

1 Answers

1
votes

Update - Nov. 2018 - Added compatibility with Woocommerce version 3.3+

This is possible hooking a custom function in manage_shop_order_posts_custom_column action hook. Below I am adding the billing phone to the existing Order ("Pedido") column data:

add_action( 'manage_shop_order_posts_custom_column' , 'custom_orders_list_column_content', 10, 2 );
function custom_orders_list_column_content( $column, $post_id ) {
    if ( $column == 'order_title' || $column == 'order_number'  )
    {
        // The billing phone for example (to be repaced by your custom field meta_key)
        $custom_field_value = get_post_meta( $post_id, '_billing_phone', true );
        if( ! empty( $custom_field_value ) )
            echo $custom_field_value;
    }
}

*Code goes in function.php file of your active child theme (or active theme) . Tested and works