Friday 4 July 2014

How to Get Customer billing and shipping information

# 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();
}

No comments:

Post a Comment

List OF BANK PAN Numbers

List OF BANK PAN Numbers Bank/Home Loan Providers PAN Number Allahabad Bank AACCA8464F Andhra Bank AABCA7375C Axis Bank...