Jump to content

hide index to front


morochojch

Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...