Mike O'Hara Posted August 30, 2011 Share Posted August 30, 2011 Prestashop newb here. I would like to have things so that when a user logs into the store, instead of directing to their My account page, I want them to drop back into the products, or another page. Is there a module for that, or how can I make that modification? Link to comment Share on other sites More sharing options...
Mike O'Hara Posted August 30, 2011 Author Share Posted August 30, 2011 Any ideas? is this not possible at all in Prestashop? Link to comment Share on other sites More sharing options...
surferboy Posted September 12, 2013 Share Posted September 12, 2013 Hey, I have the same question. Did you ever sort this issue? Thanks, Brian Link to comment Share on other sites More sharing options...
vekia Posted September 12, 2013 Share Posted September 12, 2013 to "login" page just add ?back with url of referrer page 1 Link to comment Share on other sites More sharing options...
surferboy Posted September 12, 2013 Share Posted September 12, 2013 to "login" page just add ?back with url of referrer page I'm not sure what you mean. Are you saying I should open the authentication template file and change the url? Thanks, Brian Link to comment Share on other sites More sharing options...
vekia Posted September 12, 2013 Share Posted September 12, 2013 sorry for not explain. open authentication.tpl {if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back|escape:'htmlall':'UTF-8'}" />{/if} change it to: {if isset($back)}<input type="hidden" class="hidden" name="back" value="{$smarty.server.HTTP_REFERER|escape:'htmlall':'UTF-8'}" />{/if} you will be back there, where you was before click on "login" button Link to comment Share on other sites More sharing options...
surferboy Posted September 12, 2013 Share Posted September 12, 2013 hmmm, well I followed your instructions but it still takes me to the My Account page Here is what I have currently in that portion of the authentication.tpl file: <div class="form_content clearfix"> <p class="text"> <label for="email">{l s='Email address'}</label> <span><input type="text" id="email" name="email" value="{if isset($smarty.post.email)}{$smarty.post.email|stripslashes}{/if}" class="account_input" /></span> </p> <p class="text"> <label for="passwd">{l s='Password'}</label> <span><input type="password" id="passwd" name="passwd" value="{if isset($smarty.post.passwd)}{$smarty.post.passwd|stripslashes}{/if}" class="account_input" /></span> </p> <p class="lost_password"><a href="{$link->getPageLink('password')|escape:'html'}" title="{l s='Recover your forgotten password'}" rel="nofollow">{l s='Forgot your password?'}</a></p> <p class="submit"> {if isset($back)}<input type="hidden" class="hidden" name="back" value="{$smarty.server.HTTP_REFERER|escape:'htmlall':'UTF-8'}" />{/if} <input type="submit" id="SubmitLogin" name="SubmitLogin" class="button" value="{l s='Welcome Back!'}" /> </p> </div> Thanks for looking at this. Brian Link to comment Share on other sites More sharing options...
PascalVG Posted September 13, 2013 Share Posted September 13, 2013 Hi surferboy, You may need to (TEMPORARILY!!): - turn OFF your cache and - 'Template cache' set to "Recompile templates if the files have been updated" in Advanced Parameters->Performanceto see the changes. (Don't forget to turn cache back ON afterwards!) pascal Link to comment Share on other sites More sharing options...
surferboy Posted September 13, 2013 Share Posted September 13, 2013 After looking carefully at the code you provided and that I had pasted. It essentially says return to the page from which the login request was made. Okay, that makes it easier for me to comprehend. I tried logging in at several different pages and I was delighted to see that yes, I was returned to the page where I had activated the login. I was confused because initially I was logging in FROM the login page itself, so it was returning to that same login page, which upon successful authentication, takes you to My Account. So for others reading this and saying huh?, here is a good example: with @PascalIVG's code, I can visit an individual product page, and click the login. Once the authentication is completed, I now return to that individual product page, but now logged in. Hope that makes sense to folks. Thank you Pascal. Brian Link to comment Share on other sites More sharing options...
vekia Posted September 13, 2013 Share Posted September 13, 2013 that's right this easy solution works like a charm, i usually use it in my customers shops and works well. always. best regards Link to comment Share on other sites More sharing options...
surferboy Posted September 13, 2013 Share Posted September 13, 2013 one further question about all of this: will all of these changes be lost in the next prestashop upgrade, let's say if and when 1.5.6 comes out? Link to comment Share on other sites More sharing options...
PascalVG Posted September 13, 2013 Share Posted September 13, 2013 Hi Brian, Just to put credit where credit belongs, I think it was Vekia who provided the code, not me :-) Thanks Vekia! pascal N.B. The tpl file will not be overwritten as it is (please double check one more time) it's in your theme's folder. Link to comment Share on other sites More sharing options...
vekia Posted September 13, 2013 Share Posted September 13, 2013 but you have to make sure that your theme isn't in /default/ directory. if it is - it will be overwrited in next update 1 Link to comment Share on other sites More sharing options...
PascalVG Posted September 13, 2013 Share Posted September 13, 2013 Ah yes, make your own copy of default theme whenever you change anything... Thanks Vekia, pascal 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