title: Displaying custom field of product variations within Woocommerce orders and emails
body: <p>I successfully added a custom field for product variations within the backend of WooCommerce and was able to display its value. I'd like to contain this value within order and emails as well.</p>
  
  <pre><code>//Display Fields in admin on product edit screen
  add_action( 'woocommerce_product_after_variable_attributes', 'woo_variable_fields', 10, 3 );
  
  //Save variation fields values
  add_action( 'woocommerce_save_product_variation', 'save_variation_fields', 10, 2 );
  
  // Create new fields for variations
  function woo_variable_fields( $loop, $variation_data, $variation ) {
  
  echo '&lt;div class="variation-custom-fields"&gt;';
  
    // Text Field
    woocommerce_wp_text_input( 
      array( 
        'id'          =&gt; '_text_field['. $loop .']', 
        'label'       =&gt; __( 'additional fees (e.g. monthly fee)', 'woocommerce' ), 
        'placeholder' =&gt; '',
        //'desc_tip'    =&gt; true,
        'wrapper_class' =&gt; 'form-row form-row-first',
        //'description' =&gt; __( 'Enter the custom value here.', 'woocommerce' ),
        'value'       =&gt; get_post_meta($variation-&gt;ID, '_text_field', true)
      )
    );
  
  echo "&lt;/div&gt;"; 
  
  }
  
  /** Save new fields for variations */
  function save_variation_fields( $variation_id, $i) {
  
  // Text Field
  $text_field = stripslashes( $_POST['_text_field'][$i] );
  update_post_meta( $variation_id, '_text_field', esc_attr( $text_field ) );
  }
  
  // Custom Product Variation
  add_filter( 'woocommerce_available_variation', 'custom_load_variation_settings_products_fields' );
  
  function custom_load_variation_settings_products_fields( $variations )    { 
  $variations['variation_custom_field'] = get_post_meta( $variations[ 'variation_id' ], '_text_field', true );  
  return $variations;
  }
  </code></pre>
  
  <p>I'm using the following to display the custom field's value within the cart.</p>
  
  <pre><code>add_filter( 'woocommerce_get_item_data', 'display_custom_field_as_item_data', 20, 2 );
  function display_custom_field_as_item_data( $cart_data, $cart_item ) {
      if( $value = get_post_meta( $cart_item['data']-&gt;get_id(), '_text_field', true ) ){
          $cart_data[] = array(
              'name' =&gt; __( 'Additional Monthly Fee', 'woocommerce' ),
              'value' =&gt; sanitize_text_field( $value )
          );
      }
      return $cart_data;
  }
  </code></pre>
  
  <p>Further as for now I'm displaying its value below the product price / total of each item within cart/checkout template with the following</p>
  
  <pre><code>echo get_post_meta( $_product-&gt;get_id(), '_text_field', true );
  </code></pre>
  
  <p>How about displaying the value of this field within orders and emails? </p>