ग्राहक खोजने के लिए 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;
}