morochojch Posted September 20, 2018 Share Posted September 20, 2018 greetings to all, browsing in the forum of the community I managed to find a bit of code that allows to redirect a user to initiate session if this is not loguiado ah (for the effects of private stores). if (!$this->context->customer->isLogged() && $this->php_self != 'authentication' && $this->php_self != 'password') { Tools::redirect('index.php?controller=authentication?back=my-account'); } I'm doing well but in my case I do not only need that, but the user can only navigate between the views that my account view shows (already being the session started), and avoid seeing for example the home or index of the store. Can I create an index redirect to my account even if it is logged in? , Thank you prestashop 1.7 (version). Link to comment Share on other sites More sharing options...
joseantgv Posted September 21, 2018 Share Posted September 21, 2018 16 hours ago, morochojch said: greetings to all, browsing in the forum of the community I managed to find a bit of code that allows to redirect a user to initiate session if this is not loguiado ah (for the effects of private stores). if (!$this->context->customer->isLogged() && $this->php_self != 'authentication' && $this->php_self != 'password') { Tools::redirect('index.php?controller=authentication?back=my-account'); } I'm doing well but in my case I do not only need that, but the user can only navigate between the views that my account view shows (already being the session started), and avoid seeing for example the home or index of the store. Can I create an index redirect to my account even if it is logged in? , Thank you prestashop 1.7 (version). So just redirect the customer where you need: Tools::redirect(); And you can use getPageLink(), getCategoryLink, etc. Link to comment Share on other sites More sharing options...
morochojch Posted September 25, 2018 Author Share Posted September 25, 2018 On 21/9/2018 at 3:52 AM, joseantgv said: So just redirect the customer where you need: Tools::redirect(); And you can use getPageLink(), getCategoryLink, etc. thanks for the prompt response, but the fact is that I do not use the redirection function correctly, or at least not where it should be, how would it be the correct way so that whenever I am in the index redirect to my account? 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