Is there a simple way to sovel redirect url customize in Magento?
I'v searched some articles mentions "controller".
But I have no idea about custom extensions.
How to override the base controller action with a extension?
Is there a simple way to sovel redirect url customize in Magento?
I'v searched some articles mentions "controller".
But I have no idea about custom extensions.
How to override the base controller action with a extension?
Just change the option:
System > Config > Customer
> Costumer Redirect Customer to Account Dashboard after Logging in > NO
Stores > Configuration > Customers > Customer Configuration > Login Options
Commented
Nov 4, 2016 at 4:18
Do not change core/ code. Use the following free extension: http://www.magentocommerce.com/magento-connect/customer-redirect-after-login-1.html
Take a look at this answer for more details on how to do it yourself: https://stackoverflow.com/a/16099279/3403171
For this the config setting should be -> System -> Configuration -> CUSTOMERS -> Customer Configuration -> Login Options Set: Redirect Customers to Account Dashboard after Log in = No.
But there is some more work for this to do. For this you dont need to change anything in any class.
Just add below codes in you login form phtml within <form>
tag.
<?php if (!Mage::getStoreConfigFlag(
Mage_Customer_Helper_Data::XML_PATH_CUSTOMER_STARTUP_REDIRECT_TO_DASHBOARD
)) { ?>
<input name="referer" type="hidden" value="<?php echo Mage::helper('core')->urlEncode(Mage::getBaseUrl()); ?>" />
<?php } ?>
Example of a login form,
<form action="<?php echo $this->getPostActionUrl() ?>" method="post">
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
<?php if (!Mage::getStoreConfigFlag(
Mage_Customer_Helper_Data::XML_PATH_CUSTOMER_STARTUP_REDIRECT_TO_DASHBOARD
)) { ?>
<input name="referer" type="hidden" value="<?php echo Mage::helper('core')->urlEncode(Mage::getBaseUrl()); ?>" />
<?php } ?>
<div class="block-content">
<label for="mini-login"><?php echo $this->__('Email address:') ?></label><input type="text" name="login[username]" id="mini-login" class="input-text" />
<label for="mini-password"><?php echo $this->__('Password:') ?></label><input type="password" name="login[password]" id="mini-password" class="input-text" />
<div class="mini-actions">
<a href="<?php echo $this->getForgotPasswordUrl() ?>" class="f-left"><?php echo $this->__('Forgot Your Password?') ?></a>
<button type="submit" class="button"><span><span><?php echo $this->__('Log in') ?></span></span></button>
</div>
</div>
Hope it helps!! Please upvote and accept it if helps..!!