darthdeus Posted April 3, 2012 Share Posted April 3, 2012 I need to differentiate between a logged in and logged out user in my template. Basically the pseudocode would look something like this {if $logged_in} welcome {else} you have to log in {/if} Is there any simple way to do this directly in the template, without touching the controllers? Link to comment Share on other sites More sharing options...
Jose J. Fernández Posted April 3, 2012 Share Posted April 3, 2012 Yes, there is: {if $cookie->isLogged()} Hi user {else} Hi guest {/if} The blockuserinfo module had this, you could have checked it 1 Link to comment Share on other sites More sharing options...
vinzter Posted November 18, 2012 Share Posted November 18, 2012 (edited) Hi, {if $cookie->isLogged()} is deprecated in prestashop 1.5.2 to replace it in .php files use {if $this->context->customer->isLogged()} instead In template file you can use {if $logged} Edited November 18, 2012 by vinzter (see edit history) 3 Link to comment Share on other sites More sharing options...
gokalex Posted June 24, 2019 Share Posted June 24, 2019 As of 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...
nawres Posted February 24, 2022 Share Posted February 24, 2022 {if $customer.is_logged}not working in page.tpl I need verify in identifiant page if customer logged or not can some one help me please ? 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