piaoling 2011-08-05 15:40:27
I had a requirement like customer support will able to login as any customer. Here is the code snippet i used to force customer support to login as normal user.
1 |
$customerId = (int) $this ->getRequest()->getParam( 'id' ); |
2 |
$customer = Mage::getModel( 'customer/customer' ) |
5 |
$userSession = Mage::getSingleton( 'customer/session' ); |
6 |
$userSession ->setCustomer( $customer ); |
7 |
Mage::dispatchEvent( 'customer_login' , array ( 'customer' => $customer )); |
9 |
$this ->getResponse()->setRedirect(Mage::getUrl( 'customer/account' )); |