tomkay Posted January 10, 2014 Share Posted January 10, 2014 Hello there, how can I check in the .tpl-files if a user is logged in? I want to implement a logout-link if he is logged in Thank you! Link to comment Share on other sites More sharing options...
CartExpert.net Posted January 10, 2014 Share Posted January 10, 2014 Hi. It depends which script is calling the tpl file as the PHP script is checking for the logged in state and passing it to the template file. Regards.Robin.The CartExpert Team Link to comment Share on other sites More sharing options...
vekia Posted January 10, 2014 Share Posted January 10, 2014 you can use $logged variable {if $logged} DO SOMETHING {/if} 2 Link to comment Share on other sites More sharing options...
sricco Posted June 26, 2015 Share Posted June 26, 2015 (edited) Hello, I understand the idea but my problem is: we have the "html box pro" module for prestashop 1.6. With this module we added a log in button on the right top (color blue you'll see). Since now no problem when click this button redirect to log in page where you enter your log in data. Right... i want now when log in has succefully finish redirect to home page (this works) but when i redirect to home page make no visible this button becouse the user has log in already. I found JQuery function call toogle and works. The question is how can i access by code to the html box pro module from the home page to execute the JQuery than make disappear my log in button? This is the url of our shop: http://auxiliardeaguas.es/es/ Edited June 26, 2015 by sricco (see edit history) Link to comment Share on other sites More sharing options...
Mundo Rural Posted April 5, 2017 Share Posted April 5, 2017 Hi! could you solve this issue? We are facing same issue with a module called Contentbox (contentbox.org). We added social network html buttons, in our popup section, in the navbar, but when user is already logged, we would like to hide it. In my case, i'm interested in know if there is any way to may this check in html view, using javascript? THanks if anybode can solve this issue. Link to comment Share on other sites More sharing options...
gokalex Posted June 24, 2019 Share Posted June 24, 2019 Since this is on top of google search ill add this: as of prestashop 1.7 you now need {if $customer.is_logged} (if you are editing a .tpl file) 2 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