seog Posted September 2, 2015 Share Posted September 2, 2015 (edited) Hello friends I read much solutions to redirect after login to contact page, index, cms, previous page but I need redirect to same page. Example: If customer is in product page then after log in I need that customers back to same product page. (no previous page) If customer is in category page then after log in I need that customers back to same category page. (no previous page). The login in my web is a dropdown localized in displaynav (in all pages of my web) I know that code to modify is in AuthController.php around line 337: Tools::redirect('index.php?controller='.(($this->authRedirection !== false) ? urlencode($this->authRedirection) : $back)); Best regards PS 1.6.1.1 Edited September 2, 2015 by seog (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted September 3, 2015 Share Posted September 3, 2015 you have to replace back param with referer url $_SERVER['HTTP_REFERER']; Link to comment Share on other sites More sharing options...
vekia Posted September 3, 2015 Share Posted September 3, 2015 in smarty it should look like: {$smarty.server.HTTP_REFERER} Link to comment Share on other sites More sharing options...
seog Posted September 4, 2015 Author Share Posted September 4, 2015 (edited) Hello vekia I tried with Tools::redirect('index.php?controller='.(($this->authRedirection !== false) ? urlencode($this->authRedirection) : $_SERVER['HTTP_REFERER'])); but the url redirect to error page after of login. Also tried in blockmyaccountpremiun changing this code: {if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back|escape:'html':'UTF-8'}" />{/if} to: <input type="hidden" class="hidden" name="back" value="{$smarty.server.HTTP_REFERER}" /> but if I am in product page then after the redirection is to previous visited page (category) I understand that "Referer" is previous page and I try back to same page Thank you very much for your contribution BR Edited September 4, 2015 by seog (see edit history) Link to comment Share on other sites More sharing options...
losiek Posted September 1, 2016 Share Posted September 1, 2016 Hello, i guess i have similar problem.. What i want to achieve is redirect (not logged user) to the page he was directed to (eg. using link to the specific product page from a newsletter)? To be more specific: I have a web store, which not logged users can not browse. My goal is, that all (registered) customers, who subscribe to newsletter, would be able to be redirected to the specific products they have clicked in the newsletter. At the moment (while i'm not logged in) when i open a newsletter and click on a link to the product, it directs me to the login page. After being logged in, i'm redirected to the last visited page. What to do, to be redirected to the product page i've clicked before log in? Any help would be appreciated... you have to replace back param with referer url $_SERVER['HTTP_REFERER']; Link to comment Share on other sites More sharing options...
isaac.dvory Posted December 16, 2016 Share Posted December 16, 2016 did someone managed to do this ? I used "{$smarty.server.HTTP_REFERER}" in the back value but I get an empty value Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now