title: Preserving the user line breaks in a custom text area in woocommerce
body: <p>I have managed to add a custom text area to the woocommerce product data where my client can add in a kit list that is output to the packing list for the shop floor but the line breaks don't save and the output is a flow of text making it less easy on the eye for the guys picking
  This is what I have but where and how do I make it preserve the line breaks added in the admin suite to output on the packing slip:</p>
  
  <pre><code>//General Fields
  add_action( 'woocommerce_product_options_general_product_data', 'woo_add_custom_general_fields',10,3 
  );
  add_action( 'woocommerce_process_product_meta', 'woo_add_custom_general_fields_save',10,2 );
  //variable data
  add_action('woocommerce_product_after_variable_attributes', 'variation_settings_fields', 10, 3);
  add_action('woocommerce_save_product_variation','save_variation_settings_fields',10, 2);
  
  //data tab
  
  add_action( 'woocommerce_product_data_panels', 'add_my_custom_product_data_fields',10,3 );
  add_action( 'woocommerce_process_product_meta','woocommerce_process_product_meta_fields_save',10,2 );
  function woo_add_custom_general_fields() {
  
  global $woocommerce, $post;
  
  // Textarea
  woocommerce_wp_textarea_input(
    array(
      'id'          =&gt; '_textarea[' . $post-&gt;ID . ']',
      'label'       =&gt; __( 'Kit List', 'woocommerce' ),
      'placeholder' =&gt; '',
      'description' =&gt; __( 'Enter the kit list here.', 'woocommerce' ),
      'value'       =&gt; get_post_meta( $post-&gt;ID, '_textarea', true ),
    )
  );
   }
  
  function woo_add_custom_general_fields_save( $post_id ){
  
  
  // Textarea
  $textarea = $_POST['_textarea'][ $post_id ];
  if( ! empty( $textarea ) ) {
  update_post_meta( $post_id, '_textarea', esc_attr( $textarea ) );
  }
  
  }
  
  
  
  function variation_settings_fields($loop, $variation_data, $variation){
  
  // Textarea
  woocommerce_wp_textarea_input(
    array(
      'id'          =&gt; '_textarea[' . $variation-&gt;ID . ']',
      'label'       =&gt; __( 'Kit List', 'woocommerce' ),
      'placeholder' =&gt; '',
      'description' =&gt; __( 'Enter the kit list here.', 'woocommerce' ),
      'value'       =&gt; get_post_meta( $variation-&gt;ID, '_textarea', true ),
    )
  );
  }
  function save_variation_settings_fields($post_id){
  
  // Textarea
   $textarea = $_POST['_textarea'][ $post_id ];
  if( ! empty( $textarea ) ) {
  update_post_meta( $post_id, '_textarea', esc_attr( $textarea ) );
  }
  
  
  }
  add_action( 'wpo_wcpdf_after_item_meta', 'wpo_wcpdf_product_custom_field', 10, 3 );
  function wpo_wcpdf_product_custom_field ( $template_type, $item, $order ) {
  if ( $template_type == 'packing-slip' ) {
     // check if product exists first
      if (empty($item['product'])) return;
  
      // replace 'Location' with your custom field name!
      $field_name = '_textarea';
      $textarea = method_exists($item['product'], 'get_meta') ? $item['product']
      -&gt;get_meta($field_name,true,'edit') : get_post_meta( $item['product']-&gt;id, $field_name, true );
      if (!empty($textarea)) {
          echo nl2br('Kit List: '.$textarea.'');  
      }
       }
      }
  </code></pre>