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