Last active
May 3, 2017 15:48
-
-
Save brodkin/5891705 to your computer and use it in GitHub Desktop.
Magento Force Customer Login Without Password
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
// Retrieve Customer by Email (or other method) | |
$customer = Mage::getModel('customer/customer') | |
->setWebsiteId(Mage::app()->getStore()->getWebsiteId()) | |
->loadByEmail($email); | |
// Set as Logged In and Clear Session | |
Mage::getSingleton('customer/session')->setCustomerAsLoggedIn($customer) | |
->renewSession(); | |
// Redirect or do something here :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi brodkin,
Where do i put this code in case i want customer to login without pass?
Thanks,
Kishan