How to Check Customer email id is exist or not before registration in Magento?

When you need to add user programmatically from the Magento back-end then you must check whether the user email is already exist or not before registration. As Email ID are the primary mode of login function for the back-end processes for controlling.
You can check customer email id exists or not before registration programmatically in Magento by following code.


$customer = Mage::getModel('customer/customer');
$customer->setWebsiteId(Mage::app()->getWebsite()->getId());
$customer->loadByEmail($customer_email);

if($customer->getId())
{
echo "Customer Exist";
}

With this query you will be able to check whether the user has registered on your website or not!

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *