0

I have a new field in customer register form named referral_code i just want to get this field data in my UpdateCustomerMeta observer how can i get the value of the field "referral_code" in observer of customer_register_success

4

In that event you can access controller (and so, any parameter submitted)

$this->_eventManager->dispatch(
    'customer_register_success',
    ['account_controller' => $this, 'customer' => $customer]
); 

So I think you should be able to get the request parameters this way...

$parameters = $observer->getEvent()->getAccountController()->getRequest()->getParams();
  • it shows all parameter how to get only referal_code thanks in advance. After that i will mark your ans – Abdullah Shahid Mar 21 '18 at 13:12
  • 1
    Instead of getParams() use getParam('your_parameter_here') – Raul Sanchez Mar 21 '18 at 13:24
  • Awesome Thank you – Abdullah Shahid Mar 21 '18 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.