Stéphane V Posted May 14, 2019 Share Posted May 14, 2019 Hello, I have unchecked "Visitors" and "Invited" from one category, in order to restrict the access to the product of one category only to logged in users. This is working perfectly. I get the nice message "you don't have access to this category"... I would like to add below the login form in order to prompt the user to log in, them display the category page with the parameter "back"... So turn this (current situation) : Into this (objective) : How can I do this ? I tried to attach the hook login on some hook, but it is displaying on all pages 😞 I can modify the template authentication.tpl by hardcoding this one category, but hard to maintain in the future (especially if other categroies are marked hidden) I tried to used Smarty variable of that page, but I could not found the smarty variable that says "this category is not accessible" in order to adapt the template.... the only variable I found in smarty was $notifications Array (2) value => Array (4) error => Array (1) 0 => "vous n'avez pas accès à cette catégorie" But doing a "if" based on a translated text is bad practice.... I would like to do something as {if $page.is_only_for_logged_users and $user.not_logged_in } insert login block {/if} Thanks ! Link to comment Share on other sites More sharing options...
Stéphane V Posted May 23, 2019 Author Share Posted May 23, 2019 nobody ? Link to comment Share on other sites More sharing options...
Stéphane V Posted May 28, 2019 Author Share Posted May 28, 2019 up ? I can't imagine there is no (free) solution.. ? 😞 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