1

Using Magento 2, I trying to retrieve the data (rating, nickname, ...) when the user write a review for a product. i want to retrieve this data, do some process and return back to be displayed in the screen.

How to grab this data inside the observer?

1 Answer 1

1

As this event pass Action as a parameter of event , Then you can get all field values of the review form at Observer.

$controllerAction =  $observer->getEvent()->getControllerAction ();
   $nickname = $controllerAction->getRequest()->getParam('nickname', false);
   $title = $controllerAction->getRequest()->getParam('title', false);
   $detail = $controllerAction->getRequest()->getParam('detail', false);
   $ratings = $controllerAction->getRequest()->getParam('ratings', false)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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