Chek customer login status:
Mage::getSingleton('customer/session')->isLoggedIn()
Get the customer object:
Mage::getSingleton('customer/session')->getCustomer()
Load formatted address:
$customerAddressId = Mage::getSingleton('customer/session')->getCustomer()->getDefaultBilling();
if ($customerAddressId){
$address = Mage::getModel('customer/address')->load($customerAddressId);
$htmlAddress = $address->format('html')
}
Load and print address field values:
$customerAddressId = Mage::getSingleton('customer/session')->getCustomer()->getDefaultBilling();
if ($customerAddressId){
$address = Mage::getModel('customer/address')->load($customerAddressId);
echo "<pre>"; print_r($address->getData());echo "</pre>";
}
Load single address field value:
$street = $address->getData('street');
Comments
Post new comment