Created
May 12, 2013 11:08
-
-
Save tonyoconnell/5563176 to your computer and use it in GitHub Desktop.
magento autologin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// => if you know the customer id | |
$customer = Mage::getModel('customer/customer')->load($id); | |
// => if you know the customer email address | |
$customer = Mage::getModel('customer/customer')->loadByEmail('[email protected]'); | |
if($customer->getId()) | |
{ | |
Mage::getSingleton('customer/session')->setCustomerAsLoggedIn($customer); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment