ExpandThis was my solution:
Thinking about how to solve the problem: forcing customer to register his address in customer registration process, I thought of something that is much easier, just redirect customer to the address register just after customer registration.
The solution was using the actionCustomerAccountAdd hook, in CustomerPersister.php
if ($ok) { $this->context->updateCustomer($customer); $this->context->cart->update(); $this->sendConfirmationMail($customer); Hook::exec('actionCustomerAccountAdd', [ 'newCustomer' => $customer, Tools::redirect('index.php?controller=address') //Redirect after registration ]); }
Regards
I tried this and got an immediate Error 500 when tried to open an account. Could you give me an idea as to what went wrong please?
For reference, I added this line- Tools::redirect('index.php?controller=address') //Redirect after registration -in the appropriate place as shown.