Based on Adding product attribute column to edit order page in Woocommerce answer code I wrote this function:
add_action( 'woocommerce_admin_order_item_headers', 'custom_admin_order_items_headers', 20, 1 );
function custom_admin_order_items_headers( $order ){
echo '<th>';
echo __('Marchio', 'woocommerce') . '</th>';
}
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) {
$marchio = get_the_terms( $_product->post->ID, 'pa_marchio');
echo '<td>' . $marchio[0]->name . '</td>';
}
It works for simple products but not with variable products, how can fix it?