Fabietto Posted March 30, 2016 Share Posted March 30, 2016 I'm a newbie and I hope someone could help me!I'm looking for a solution for this problem: in the product page, I want a download button for the product specification that is available only if I am logged in; so, if I'm not, I click on the button, log in or create new account, than I want to go back to the product page and download the product specification.It seems not so complicated but I'm not able to find a solution! I'll try to set a variable to store the product url to use for redirect after login...no way! How can I do?Sorry for my english, hope you understand my issue.Thanks a lot! Fabietto Link to comment Share on other sites More sharing options...
electriz Posted March 30, 2016 Share Posted March 30, 2016 (edited) In product.tpl add wherever you want. {if $logged} // your code when user is logged in {else} // your code when not logged {/if} Edited March 30, 2016 by electriz (see edit history) 1 Link to comment Share on other sites More sharing options...
Fabietto Posted March 30, 2016 Author Share Posted March 30, 2016 Tnx electriz! This part is already done...but I'm in trouble with the second part: go back to the product page after login... Link to comment Share on other sites More sharing options...
electriz Posted April 5, 2016 Share Posted April 5, 2016 (edited) I think you should set a variable (or cookie) just before redirection. And edit the login page to check if your cookie/variable is set. If so, make redirection to the product page. If it is not set, keep the default behavior. Not as easy as it seems Edited April 5, 2016 by electriz (see edit history) Link to comment Share on other sites More sharing options...
Fabietto Posted April 5, 2016 Author Share Posted April 5, 2016 Thank you electriz! Yes, you say right! But my problem is that I'm already try to set a variable (I'm trying with Smarty variable, set as global or root ecc...) but with no success. I think there must be a simple way to set a variable and share it in this enviroment, or not?? Tnx a lot for your help! 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