isCategoryListing example


    public function handleRequest(
        Request $request,
        Criteria $criteria,
        ShopContextInterface $context
    ) {
        if ($this->isSearchPage($request)) {
            $ids = $this->config->get('searchFacets', '');
            /** @var int[] $ids */
            $ids = array_filter(explode('|', $ids));
            $customFacets = $this->facetService->getList($ids$context);
        } elseif ($this->isCategoryListing($request)) {
            $categoryId = (int) $request->getParam('sCategory');
            $customFacets = $this->facetService->getFacetsOfCategories([$categoryId]$context);
            /** @var CustomFacet[] $customFacets */
            $customFacets = array_shift($customFacets);
        } else {
            $customFacets = $this->facetService->getAllCategoryFacets($context);
        }

        foreach ($customFacets as $customFacet) {
            if (!$customFacet->getFacet()) {
                continue;
            }
Home | Imprint | This part of the site doesn't use cookies.