Add a custom field (in an order) to the emails in WooCommerce
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme.
/** * Add a custom field (in an order) to the emails */ add_filter( 'woocommerce_email_order_meta_fields', 'custom_woocommerce_email_order_meta_fields', 10, 3 ); function custom_woocommerce_email_order_meta_fields( $fields, $sent_to_admin, $order ) { $fields['meta_key'] = array( 'label' => __( 'Label' ), 'value' => get_post_meta( $order->id, 'meta_key', true ), ); return $fields; }