Friday, July 20, 2012

Customer Login By Id in Magento


    >> $email = "name@gmail.com";
          $customer = Mage::getModel('customer/customer');
          $customer->setWebsiteId(Mage::app()->getWebsite()->getId());
          $customer->loadByEmail(trim($email));
          Mage::getSingleton('customer/session')->loginById($customer->getId());



No comments:

Post a Comment