In a custom module I am adding data to a line item added to the cart like this:
$user_to_add =_get_user_by_ain($ain);
$product = commerce_product_load($product_id);
$line_item = commerce_product_line_item_new($product, 1, 0, array('apply_to_user' => $user_to_add));
commerce_cart_product_add($user->uid, $line_item);
This data is used in Rules after checkout is completed. What I'm struggling with now is being able to show that data in the cart view (default, Commerce provided, commerce_cart_form). For example, if the $user_to_add contains the users first name, I'd like to be able to show that in the cart view next to the product label.
I've been going through the views api, testing the hooks available, and I can't figure out where to do this. In the hooks that I've tried, the data is is available in $view->result[0]->_field_data['commerce_line_item_field_data_commerce_line_items_line_item_]['entity']->data['apply_to_user']