Есть 2 способа найти адрес доставки клиента / пользователя-
function get_user_shipping_address(){
global $user;
$default_pid =commerce_addressbook_get_default_profile_id($user->uid,'shipping');
После получения идентификатора профиля вы можете загрузить профиль и получить имя клиента и адрес
$profile_load = commerce_customer_profile_load($default_pid);
$first_line = $profile_load->commerce_customer_address['und'][0]['name_line'];
$landmark = $profile_load->commerce_customer_address['und'][0]['sub_premise'];
$postal_code = $profile_load->commerce_customer_address['und'][0]['postal_code'];
$state = $profile_load->commerce_customer_address['und'][0]['locality'];
$add[] = $first_line . ' ' . $landmark . ' ' . $postal_code . ' ' . $state;
return $add;
}
Второй способ, если у вас есть $ заказ
function get_default_address_of_customer_by_order_id($order) {
$order1 = commerce_order_load($order);
$shipping_id = $order1->commerce_customer_shipping['und'][0]['profile_id'];
$address = commerce_customer_profile_load($shipping_id);
$first_line = $address->commerce_customer_address['und'][0]['name_line'];
$landmark = $address->commerce_customer_address['und'][0]['sub_premise'];
$postal_code = $address->commerce_customer_address['und'][0]['postal_code'];
$state = $address->commerce_customer_address['und'][0]['locality'];
$add[] = $first_line . ' ' . $landmark . ' ' . $postal_code . ' ' . $state;
return $add;
}