ProductDescriptionReviewsStruct example

public function __construct(private readonly AbstractProductReviewRoute $productReviewRoute)
    {
    }

    public function getType(): string
    {
        return 'product-description-reviews';
    }

    public function enrich(CmsSlotEntity $slot, ResolverContext $resolverContext, ElementDataCollection $result): void
    {
        $data = new ProductDescriptionReviewsStruct();
        $slot->setData($data);

        $productConfig = $slot->getFieldConfig()->get('product');
        if ($productConfig === null) {
            return;
        }

        $request = $resolverContext->getRequest();
        $ratingSuccess = (bool) $request->get('success', false);
        $data->setRatingSuccess($ratingSuccess);

        
Home | Imprint | This part of the site doesn't use cookies.