I want to pass some custom data to the product review form when the review from loads after the review saved. How to do that using events?
/**
* @Route("/product/{productId}/reviews", name="frontend.product.reviews", methods={"GET","POST"}, defaults={"XmlHttpRequest"=true})
*/
public function loadReviews(Request $request, RequestDataBag $data, SalesChannelContext $context): Response
{
$reviews = $this->reviewPageletLoader->load($request, $context);
return $this->renderStorefront('storefront/page/product-detail/review/review.html.twig', [
'reviews' => $reviews,
'ratingSuccess' => $request->get('success'),
]);
}
This is the review loading action in ProductController.php (shopware controller).
I am using ProductEvents::PRODUCT_REVIEW_LOADED event. but unfortunately, I am not able to find any solution to this. how to do that?