magento check email exist

来源:互联网 发布:淘宝店铺监控入口 编辑:程序博客网 时间:2024/06/05 21:59
<?phprequire_once 'app/Mage.php';umask(0);$websiteId = Mage::app()->getWebsite()->getId();$email = 'ajzele@someserver123.com';// Your Customers Email Herefunction IscustomerEmailExists($email, $websiteId = null){    $customer = Mage::getModel('customer/customer');    if ($websiteId) {        $customer->setWebsiteId($websiteId);    }    $customer->loadByEmail($email);    if ($customer->getId()) {        return $customer->getId();    }    return false;}$cust_exist = IscustomerEmailExists($email,$websiteId);if($cust_exist){    echo "Customer Email Exists Already. And your Customer id is <b>'".$cust_exist."'</b>";}else{     echo "Customer Email <b>'".$email."'</b> Not Exists : So you Need to Enter All data like shipping info ,billing info";}?>
0 0