If you know the customer id than direct use it other wise
first you can get customer id than use that.
$customerId =2; // already known
Mage::getSingleton('customer/session')->loginById($customerId);
$customerAddressId =
Mage::getSingleton('customer/session')->getCustomer()->getDefaultShipping();
$address =
Mage::getModel('customer/address')->load($customerAddressId);
$address_data = array (
'prefix' => $address->getPrefix(),
'firstname' =>
$address->getFirstname(),
'lastname' =>
$address->getLastname(),
'street' => $address->getStreet(),
'city' =>
$address->getCity(),
'region_id'
=> $address->getRegionId(),
'region'
=> $address->getRegion(),
'postcode'
=> $address->getPostcode(),
'country_id'
=> $address->getCountryId(),
'telephone'
=> $address->getTelephone(),
'email'
=> $address->getEmail()
);
No comments:
Post a Comment