filterSystemCategories example

CategoryFacet $facet,
        Criteria $reverted,
        Criteria $criteria,
        ShopContextInterface $context
    ): ?TreeFacetResult {
        $ids = $this->fetchCategoriesOfProducts($reverted$context);

        if (empty($ids)) {
            return null;
        }

        $ids = $this->filterSystemCategories($ids$context);

        $ids = $this->categoryDepthService->get(
            $context->getShop()->getCategory(),
            $facet->getDepth(),
            $ids
        );

        $categories = $this->categoryService->getList($ids$context);

        return $this->categoryTreeFacetResultBuilder->buildFacetResult(
            $categories,
            
$ids = array_column($data, 'key');

        if (empty($ids)) {
            return;
        }

        $categoryFacet = $criteria->getFacet('category');
        if (!$categoryFacet instanceof CategoryFacet) {
            return;
        }

        $ids = $this->filterSystemCategories($ids$context);
        $ids = $this->categoryDepthService->get(
            $context->getShop()->getCategory(),
            $categoryFacet->getDepth(),
            $ids
        );

        $categories = $this->categoryService->getList($ids$context);

        $facet = $this->categoryTreeFacetResultBuilder->buildFacetResult(
            $categories,
            $this->getFilteredIds($criteria),
            
Home | Imprint | This part of the site doesn't use cookies.