title: WooCommerce: Add input field to every item in cart
body: <p>I've been trying to add a single text input field to every item in the cart and submit that user input to product's meta info. It's been 2 days and I haven't succeeded yet.</p>
  
  <p>My objective is to:</p>
  
  <ol>
  <li>Take input from user for every item added to the cart.</li>
  <li>Display that input in the order's meta info.</li>
  <li>Display that input in confirmation email sent to the customer.</li>
  </ol>
  
  <p>So far, I have copied the template file to my theme and added an input field inside a cell. I'm having trouble with the hooks, learned about hooks I will need from <a href="http://wordpress.org/plugins/woocommerce-product-gift-wrap/">WooCommerce Product Gift Wrap</a> plugin as indicated in this <a href="https://github.com/woothemes/woocommerce/issues/2105">woocommerce issue</a>.</p>
  
  <p>Code I added to the cart.php template copied in my theme directory :</p>
  
  <pre><code>$input_url_data = '&lt;div class="input-url"&gt;&lt;input type="text" name="cart-url" value="" title="" class="input-text cart-url text" /&gt;&lt;/div&gt;';
  
  echo apply_filters( 'woocommerce_add_cart_item_data', $input_url_data, $cart_item_key );
  </code></pre>
  
  <p>Code I added to my theme's functions.php :</p>
  
  <pre><code>add_filter( 'woocommerce_add_cart_item_data','add_cart_item_data', 10, 2 );
  add_filter( 'woocommerce_get_cart_item_from_session','get_cart_item_from_session', 10, 2 );
  add_filter( 'woocommerce_get_item_data','get_item_data', 10, 2 );
  add_filter( 'woocommerce_add_cart_item','add_cart_item', 10, 1 );
  add_action( 'woocommerce_add_order_item_meta','add_order_item_meta', 10, 2 );
  
  function add_cart_item_data( $cart_item_meta, $product_id ) {
      $input_url_key = "";
      $input_url_data['inputurl'] = $input_url_key;
      return $input_url_data;
  }
  
  function get_cart_item_from_session( $cart_item, $values ) {
  
  if ( ! empty( $values['inputurl'] ) ) {
      $cart_item['inputurl'] = true;
  }
  return $cart_item;
  }
  
  function get_item_data( $item_data, $cart_item ) {
  
  if ( ! empty( $cart_item['inputurl'] ) )
      $item_data[] = array(
      );
  return $item_data;
  }
  
  function add_cart_item( $cart_item ) {
  if ( ! empty( $cart_item['inputurl'] ) ) {
  
  }
  return $cart_item;
  }
  
  function add_order_item_meta( $item_id, $cart_item ) {
  if ( ! empty( $cart_item['inputurl'] ) )
  woocommerce_add_order_item_meta( $item_id, __( 'URL by buyer', 'custom_input_url' ), __( 'Yes', 'custom_input_url' ) );
  }
  </code></pre>
  
  <p>Documentation about hook woocommerce_add_cart_item_data isn't very helpful and I'm stuck at this. How do I proceed?</p>