Beaniie Posted February 21, 2017 Share Posted February 21, 2017 (edited) Good Morning, Currently trying to dig my way around Prestashop, 1.6.1.11. I understand it a little bit but I wouldn't say I'm experienced. I'm after a way to check if the user is logged in, which I have found examples for this elsewhere using .tpl files. However I need to action a response if the user is not logged in The thread I found is the reverse of which. After considerable digging I was able to find and edit this code here, but I'm unable to get it to fire; <!-- Check Login --> <div id="check-log"> {if $logged} <a href=".." id="Logout" />Logout</a> {else} <a href=".." id="Login" />Login</a> {/if} </div> I currently have this placed within my 'header.tpl'. As a bit of background as to what it is specifically that I'm trying to achieve is to display a full width / height image with a sign-in element layered over top within the center. I want to essentially give the user only one element to interact with and use to sign in. I hope I have explained myself well enough, any help is appreciated. I'll keep looking and if I find anything useful I'll post it here. Regards, - B Edited February 21, 2017 by Beaniie (see edit history) Link to comment Share on other sites More sharing options...
Beaniie Posted February 21, 2017 Author Share Posted February 21, 2017 Turns out a simple syntax error was the culprit. All works perfectly. Regards, -B Link to comment Share on other sites More sharing options...
mmateus7 Posted November 17, 2017 Share Posted November 17, 2017 On 2/21/2017 at 0:01 PM, Beaniie said: Turns out a simple syntax error was the culprit. All works perfectly. Regards, -B What was your problem? Im trying something like that but the text never changes... Here is what i have. It always shows create account and login text {if $logged} <a style="padding-right: 10px; float: right" class="logout" href="{$logout_url}" rel="nofollow" > {l s='Sign out' d='Shop.Theme.Actions'} </a> <a class="account" href="{$my_account_url}" title="{l s='View my customer account' d='Shop.Theme.CustomerAccount'}" rel="nofollow" > {$customerName} </a> {else} <a style="padding-right: 15px; float: right" class="login" href="inicio-de-sessao" title="{l s='' d='Shop.Theme.CustomerAccount'}" rel="nofollow" > {l s='Sign in' d='Shop.Theme.Actions'} </a> <a style="padding-right: 15px; float: right" class="no-account" href="inicio-de-sessao?create_account=1" title="{l s='' d='Shop.Theme.CustomerAccount'}" rel="nofollow" > {l s='Criar Conta' d='Shop.Theme.Actions'} </a> {/if} Link to comment Share on other sites More sharing options...
bellini13 Posted November 17, 2017 Share Posted November 17, 2017 when you post code here, change the code type from html to php, or from html to no syntax. the code you are posting above is not html and therefore looks terrible and cannot be properly read 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} 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