Monday 5 August 2013

magento redirect on custom url after login

<?php

if (!Mage::getSingleton("customer/session")->isLoggedIn())
{
$session = Mage::getSingleton("customer/session");

 $session->setBeforeAuthUrl(Mage::helper("core/url")->getCurrentUrl());

$customerLoginURL = $this->getBaseUrl() . "customer/account/login";

Mage::app()->getFrontController()->getResponse()->setRedirect($customerLoginURL)->sendResponse();

 }
 ?>

No comments: