# Getting customer billing address information
$quote = Mage::getSingleton(‘checkout/session’)->getQuote();
$billingAddress = $quote->getBillingAddress();
$country = $billingAddress->getCountryId();
$city = $billingAddress->getCity();
$zipcode = $billingAddress->getPostcode();
# Get customer default billing information
$customerAddressId = Mage::getSingleton(‘customer/session’)->getCustomer()->getDefaultBilling();
if ($customerAddressId){
$address = Mage::getModel(‘customer/address’)->load($customerAddressId);
$address->getData();
}
# Get customer default shipping information
$customerAddressId = Mage::getSingleton(‘customer/session’)->getCustomer()->getDefaultShipping();
if ($customerAddressId){
$address = Mage::getModel(‘customer/address’)->load($customerAddressId);
$address->getData();
}
$quote = Mage::getSingleton(‘checkout/session’)->getQuote();
$billingAddress = $quote->getBillingAddress();
$country = $billingAddress->getCountryId();
$city = $billingAddress->getCity();
$zipcode = $billingAddress->getPostcode();
# Get customer default billing information
$customerAddressId = Mage::getSingleton(‘customer/session’)->getCustomer()->getDefaultBilling();
if ($customerAddressId){
$address = Mage::getModel(‘customer/address’)->load($customerAddressId);
$address->getData();
}
# Get customer default shipping information
$customerAddressId = Mage::getSingleton(‘customer/session’)->getCustomer()->getDefaultShipping();
if ($customerAddressId){
$address = Mage::getModel(‘customer/address’)->load($customerAddressId);
$address->getData();
}
No comments:
Post a Comment