Skip to content

Instantly share code, notes, and snippets.

@tonyoconnell
Created May 12, 2013 11:08
Show Gist options
  • 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('[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