Jump to content

New customer in specific group redirect after account creation


spk

Recommended Posts

Hej folks,

 

I'm trying to create a feature to redirect a new user that is a retailer to a specific CMS-page.

 

I have created a function in AuthController.php to set the customer to inactive (also sets group id to 4) by default.

The retailer uses the create account function using a specific link containing ?retail=1. By doing this i use a script on the login#create_account that check a hidden input field (name="retail") and set it to value 1.

 

All going fine this far, a retail account is created and it is set to inactive by default. But when the retailer clicks on "Create account" he will only get sent to the login page again. I would like to add something like login?retail=1&success=1 and if success = 1 in the URL i'll show a message containing some information useful for the retailer.

 

I have been trying to modify both FrontController.php and AuthController.php, and when I try using the hidden post variable if ($_POST['retail'] == '1') nothing happens. But if I don't use the if statement it works.

 

I've tried this on line 702 in the AuthController.php. Right under the commented string: 

// if register process is in two steps, we display a message to confirm account creation
if ($_POST['retail'] == '1') {
$linkToRedirect = $this->context->link->getCMSLink(19);
Tools::redirect($linkToRedirect);
}

Anyone got an idea how to solve this? 

 

 

Regards,

spk

Edited by spk (see edit history)
Link to comment
Share on other sites

  • 9 months later...

Hi

 

Sorry I have no answer for you. But I'm facing the same problem.

Have you found a solution? If yes can you tell me witch one please?

 

I just want to redirect and/or show a message after registration (I disable the account also after registration) . But prestashop force to be on the login or registration page...

 

Really annoying

 

Thank you

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...