Saturday, 5 March 2011

get collection of customer all address in magento


Use the following code to retrieve all address of customer with the help of its email id.


<?php
$websiteid = Mage::app()->getwebsite->getid();
$store = Mage::app()->getStore();

$customer = Mage::getModel("customer/customer");
$customer->website_id = $websiteid;
$customer->setStore($store);
$customer->loadByEmail("dexte@yahoo.com");
$address = Mage::getModel("Customer/Entity_Address_Collection");
$address->setCustomerFilter($customer);
$addtess->load();
?>

No comments:

Post a Comment