handlePointsAggregation example

$sorting = new FieldSorting('points', 'DESC');
        }

        $criteria->addSorting($sorting);

        if ($request->get('language') === self::FILTER_LANGUAGE) {
            $criteria->addPostFilter(
                new EqualsFilter('languageId', $context->getContext()->getLanguageId())
            );
        }

        $this->handlePointsAggregation($request$criteria);

        return $criteria;
    }

    private function handlePointsAggregation(Request $request, Criteria $criteria): void
    {
        $points = $request->get('points', []);

        if (\is_array($points) && \count($points) > 0) {
            $pointFilter = [];
            foreach ($points as $point) {
                
$sorting = new FieldSorting('points', 'DESC');
        }

        $criteria->addSorting($sorting);

        if ($request->get('language') === self::FILTER_LANGUAGE) {
            $criteria->addPostFilter(
                new EqualsFilter('languageId', $context->getContext()->getLanguageId())
            );
        }

        $this->handlePointsAggregation($request$criteria$context);

        return $criteria;
    }

    /** * get review by productId and customer * a customer should only create one review per product, so if there are more than one * review we only take one * * @throws InconsistentCriteriaIdsException */
    
Home | Imprint | This part of the site doesn't use cookies.