mayah Posted August 21, 2017 Share Posted August 21, 2017 Hello, I need help with Prestashop 1.6 and will appreciate any answers, thank you! I need to show prices only to logged in users AND inform them that the need to log in on product page and product lists. What I've done: 1) Disabled price showing for visitors and guests; 2) Put this function in product.tpl and product-list.tpl where I want it to appear: {if !$logged} <p>Notice: Please <a href="/login">log in</a> to see the prices</p> {/if} Everything works fine, but the problem is that when user is logged in, this message is still showing. I need it to be hidden or simply not displayed when user is logged in. What did I do wrong? Thank you so much. Link to comment Share on other sites More sharing options...
Scully Posted August 23, 2017 Share Posted August 23, 2017 (edited) $logged doesn't exis at all. Hence your code was looking like working because your condition asks if it is not set. It's not set because not existing. But the good is: All code is already available, even the if clause to show prices. Your use the existing code. In your product.tpl you fine a line like this around line # 263: {if $product->show_price && !isset($restricted_country_mode) && !$PS_CATALOG_MODE} The corresponding end if is found at appx. line 317, replace the simple /if with the following {else} <h4>Please log in to see prices</h4> {/if} {*close if for show price*} If you have done so, everything is controlled by the group setting => show prices. Edited August 23, 2017 by Scully (see edit history) 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