You can use the following code:
// Add custom column headers here add_action('woocommerce_admin_order_item_headers', 'my_woocommerce_admin_order_item_headers'); function my_woocommerce_admin_order_item_headers() { // set the column name $column_name = 'Test Column'; // display the column name echo '<th>' . $column_name . '</th>'; } // Add custom column values here add_action('woocommerce_admin_order_item_values', 'my_woocommerce_admin_order_item_values', 10, 3); function my_woocommerce_admin_order_item_values($_product, $item, $item_id = null) { // get the post meta value from the associated product $value = get_post_meta($_product->post->ID, '_custom_field_name', 1); // display the value echo '<td>' . $value . '</td>'; }
I commented on this so that it is clear enough, but in a nutshell this code adds a custom column called "Test Column", and this column extracts a value from a custom product field called "_custom_field_name" ,.
source share