addCurrentFilters example

foreach ($filters as $filter) {
            if ($filter->isFiltered()) {
                $criteria->addPostFilter($filter->getFilter());
            }
        }

        $criteria->addExtension('filters', $filters);
    }

    public function process(Request $request, ProductListingResult $result, SalesChannelContext $context): void
    {
        $this->addCurrentFilters($result);

        foreach ($this->factories as $factory) {
            $factory->process($request$result$context);
        }
    }

    private function addCurrentFilters(ProductListingResult $result): void
    {
        $filters = $result->getCriteria()->getExtension('filters');
        if (!$filters instanceof FilterCollection) {
            return;
        }
Home | Imprint | This part of the site doesn't use cookies.