NFORLA Posted April 24, 2020 Share Posted April 24, 2020 Hello everyone! I'm a little bit burnedout today so i thought that asking the community was a good idea. So, i'm having some trouble when trying to redirect the user after registration. I'm using the hook 'actionCustomerAccountAdd' to do some stuff like generating email verification tokens and sending the emails. After all that processing i'm generating a link to a Custom FrontController: $registrationRedirectUrl = $this->context->link->getModuleLink($this->name, 'Registration'); which results in: http://127.0.0.1/prestashop/es/module/<module_name>/Registration Now, i have verified that the link is correct as it displays the custom template i've made for this. After this i just call(last line of the hook's function code): Tools::redirect($registrationRedirectUrl); When i register a new user everything works okey but when the time comes to redirect it just goes to 127.0.0.1(no, not to 127.0.0.1/prestashop). I've searched but couldn't find anything that pointed me to the solution. I've tried using Tools:redirectLink() with the same result. Any help would be greatly appreciated!! Link to comment Share on other sites More sharing options...
NFORLA Posted April 28, 2020 Author Share Posted April 28, 2020 Anyone? Link to comment Share on other sites More sharing options...
Chill_user Posted April 30, 2020 Share Posted April 30, 2020 Try this: Tools::redirect('$registrationRedirectUrl'); But in my module, I am using differently (for example): Tools::redirectLink('https://domain.com/connexion?create_account=1'); Link to comment Share on other sites More sharing options...
NFORLA Posted April 30, 2020 Author Share Posted April 30, 2020 1 hour ago, Amantha Bill said: Try this: Tools::redirect('$registrationRedirectUrl'); But in my module, I am using differently (for example): Tools::redirectLink('https://domain.com/connexion?create_account=1'); Hey, thank you for the reply! I'm afraid it didn't worked in my case, i'm starting to think is has somthing to do with my Apache's config but i don't know. Anyway, again, thanks! Link to comment Share on other sites More sharing options...
Chill_user Posted May 1, 2020 Share Posted May 1, 2020 Check tools redirect class in /classes and inspect the code. 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