Featured Articles
If you need to go back to same page once it logged in then in list page and clicked to sign in link and then you logged in it has to go back to list page its self
Magento has default setting for not to redirect account page if you logged in from default page by default it will redirect to account dash board but you need to go page to list page for that follow the below steps--
Open header.phtml add this code at top of the file
[php]
if(!Mage::helper('customer')->isLoggedIn()) {
$loginback=$this->helper('core/url')->getCurrentUrl();
$check=strstr($loginback, 'customer/account/login');
if(!strlen($check)){
Mage::getSingleton('core/session')->setLoginBackUrl($loginback);
}
}
[/php]
override app\code\core\Mage\Customer\controllers\AccountController.php to you local or custom module and add this function
[php]
public function _loginPostRedirect()
{
$session = $this->_getSession();
if (!$session->getBeforeAuthUrl() || $session->getBeforeAuthUrl() == Mage::getBaseUrl()) {
// Set default URL to redirect customer to
$session->setBeforeAuthUrl(Mage::helper('customer')->getAccountUrl());
// Redirect customer to the last page visited after logging in
if ($session->isLoggedIn()) {
$backUrlcustom=Mage::getSingleton('core/session')->getLoginBackUrl();
if (!Mage::getStoreConfigFlag('customer/startup/redirect_dashboard')) {
$referer = $this->getRequest()->getParam(Mage_Customer_Helper_Data::REFERER_QUERY_PARAM_NAME);
if ($referer) {
$referer = Mage::helper('core')->urlDecode($referer);
if ($this->_isUrlInternal($referer)) {
$session->setBeforeAuthUrl($referer);
}
}
} else if ($session->getAfterAuthUrl()) {
$session->setBeforeAuthUrl($session->getAfterAuthUrl(true));
} else if (strlen($backUrlcustom)) {
Mage::getSingleton('core/session')->setLoginBackUrl('');
$session->setBeforeAuthUrl($backUrlcustom);
}
} else {
$session->setBeforeAuthUrl(Mage::helper('customer')->getLoginUrl());
}
} else if ($session->getBeforeAuthUrl() == Mage::helper('customer')->getLogoutUrl()) {
$session->setBeforeAuthUrl(Mage::helper('customer')->getDashboardUrl());
} else {
if (!$session->getAfterAuthUrl()) {
$session->setAfterAuthUrl($session->getBeforeAuthUrl());
}
if ($session->isLoggedIn()) {
$session->setBeforeAuthUrl($session->getAfterAuthUrl(true));
}
}
$this->_redirectUrl($session->getBeforeAuthUrl(true));
}
[/php]
Article source: https://article-realm.com/article/Arts-Entertainment/Celebrities/42138-Magento-Redirect-back-to-page-after-logged-in-in-Magento.html
Comments
Reviews
Most Recent Articles
- Oct 10, 2026 Muslim Astrologer in Kolkata and Tantrik in Kolkata by Alzbeta Berka
- Oct 10, 2026 Vastu Consultant in Kolkata and Vashikaran Specialist in Kolkata by Alzbeta Berka
- Jun 4, 2026 Famous Astrologer in Kolkata for Accurate Online Astrology Consultation by Alzbeta Berka
- Jun 4, 2026 Genuine Astrologer in Kolkata for Trusted Guidance and Life Solutions by Alzbeta Berka
- Jun 4, 2026 Astrology Services in Kolkata for Accurate Guidance and Life Solutions by Alzbeta Berka
Most Viewed Articles
- 3841 hits Bike Learning & Riding While Using Motorcycle Boots Houston & Leather Accessories by Motorcycle Accessories
- 2322 hits Shop a variety of trendy Muslim headscarf online by Lisa Stewart
- 2232 hits What To Know About Musician's Union Fees by Michael Welsh Productions
- 2123 hits Which is a right place to buy the 3D business cards? by E-plasticcards
- 1630 hits Importance of Custom-Designed Business Signs by Harry Landri
Popular Articles
In today’s competitive world, one must be knowledgeable about the latest online business that works effectively through seo services....
81558 Views
Walmart is being sued by a customer alleging racial discrimination. The customer who has filed a lawsuit against the retailer claims that it...
63507 Views
Are you caught in between seo companies introduced by a friend, researched by you, or advertised by a particular site? If that is...
37331 Views
Facebook, the best and most used social app in the world, has all the social features you need. However, one feature is missing. You cannot chat...
23616 Views
If you have an idea for a new product, you can start by performing a patent search. This will help you decide whether your idea could become the...
14871 Views
Moving becomes easy when you have the right moving accessories. These moving accessories help secure and protect your item by ensuring that no harm...
13248 Views
A lot of us look forward to the result of moving and not the process itself. It is pretty typical behavior, though. As modern people, many things...
13187 Views
Building a custom home is an exciting adventure. It’s your chance to bring your vision to life and create an area that sincerely displays...
12935 Views
Moving from one state, city, or even to a whole different county, is something that is either dictated by choice or circumstance. This is because,...
11991 Views
Statistics
| Members | |
|---|---|
| Members: | 17190 |
| Publishing | |
|---|---|
| Articles: | 79,741 |
| Categories: | 202 |
| Online | |
|---|---|
| Active Users: | 824 |
| Members: | 4 |
| Guests: | 820 |
| Bots: | 2759 |
| Visits last 24h (live): | 5810 |
| Visits last 24h (bots): | 29395 |