Skip to content

Instantly share code, notes, and snippets.

@tonyoconnell
Created May 12, 2013 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonyoconnell/5563176 to your computer and use it in GitHub Desktop.
Save tonyoconnell/5563176 to your computer and use it in GitHub Desktop.
magento autologin
// => 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('some@email.com');
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