wzzly Posted August 25, 2021 Share Posted August 25, 2021 Hi there, I hope someone can help me with this. I'm looking for a way to add a register/login button on the product page (but offcourse only when a customer is not logged in). The button should be on every product page and should say something like: "Create an account or log in to view your prices". Can't find a module for it, but it seems to me it should be possible with a line of code? Link to comment Share on other sites More sharing options...
SmartDataSoft Posted August 25, 2021 Share Posted August 25, 2021 @wzzly Which version of PrestaShop you are using and what is your theme name. This two information will help community member to help you fast Thank you Link to comment Share on other sites More sharing options...
wzzly Posted August 25, 2021 Author Share Posted August 25, 2021 (edited) @SmartDataSoft thanks for your reply. Prestashop 1.7.8 with theme warehouse (IQIT) Edited August 25, 2021 by wzzly (see edit history) Link to comment Share on other sites More sharing options...
SmartDataSoft Posted August 25, 2021 Share Posted August 25, 2021 @wzzly In that case need to check your theme use ps_customeraccountlinks or other module if they follow latest 1.7.x architecture and use WidgetInterface then you are able to hook the module in your product page. This is the easy solution Thank you Link to comment Share on other sites More sharing options...
wzzly Posted August 25, 2021 Author Share Posted August 25, 2021 @SmartDataSoft thanks. I tried it and it works. But I'm looking for a way that I can manipulate the text and appearance of the button and don't want anything to show when customer is logged in. Isn't there a way to add it in a tpl file, with a variable, if{notlogged}{ button}, or something like that lol Link to comment Share on other sites More sharing options...
SmartDataSoft Posted August 26, 2021 Share Posted August 26, 2021 12 hours ago, wzzly said: @SmartDataSoft Isn't there a way to add it in a tpl file, with a variable, if{notlogged}{ button}, or something like that lol You can also try with ps_customersignin module in this module has variable for log in and log out user 1.7.7.0/modules/ps_customersignin/ps_customersignin.tpl , the previous module ps_customeraccountlinks has no variable for access log in or log out user <div class="user-info"> {if $logged} <a class="logout" href="{$urls.actions.logout}" rel="nofollow" title="{l s='Log me out' d='Shop.Theme.Customeraccount'}">{l s='Sign out' d='Shop.Theme.Actions'}</a> <a class="account" href="{$urls.pages.my_account}" title="{l s='View my customer account' d='Shop.Theme.Customeraccount'}" rel="nofollow"><span>{$customerName}</span></a> {else} <a class="login" href="{$urls.pages.my_account}" rel="nofollow" title="{l s='Log in to your customer account' d='Shop.Theme.Customeraccount'}">{l s='Sign in' d='Shop.Theme.Actions'}</a> {/if} </div> Do not forget to click the love icon to the solution Thank you 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