Jump to content

Edit History

Track

Track

  On 9/9/2022 at 8:33 AM, Welele said:

This 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

Expand  

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.

Track

Track

  On 9/9/2022 at 8:33 AM, Welele said:

This 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

Expand  

I tried this and got an immediate Error 500 when tired 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.

×
×
  • Create New...