I'm trying to set a user's profile fields into the checkout process. A user must change these data only in own profile. The uc_addresses module is unsuitable for my needs. In the order form I need to hide these fields.
Right now I'm using uc_cart_checkout_form_alter
to do this:
function my_module_form_uc_cart_checkout_form_alter(&$form, $form_state, $form_id) {
// load user data
global $user;
$user_fields =user_load($user->uid);
$first_name = $user_fields->field_name['und']['0']['value'];
// add data to order form
$form['panes']['delivery']['delivery_first_name'][LANGUAGE_NONE][0]['value']['#default_value'] = $first_name;
}
But default value isn't there. Where did I go wrong? How can I fill out an order form (Delivery & Billing information) programmatically in Ubercart?