Customer Model Magento

While working in Magento, you might have seen that there are various model defined like sales,catalog etc.

I am writing here a script for working with customer model.


$customerModel = Mage::getModel('customer/customer'); //get customer model

$customerCollection = $customerModel->getCollection();
$customers = array();
$i = 0;
foreach ($customerCollection as $customer)
	$customer = $customerModel->load($customer->getId());
	$customers[$i]['name'] = $customer->getName();
	$customers[$i]['email'] = $customer->getEmail();

foreach($customers as $k => $v)
	echo 'Customer name :'.$v['name'];
        echo 'Customer Email :'.$v['email'];
        echo '<br/>';

I hope it is useful to you.

2 Responses to “Customer Model Magento”

  1. Prashanth says:

    Thanks dude… helped me in emergency

Leave a Reply