getCategoryIdsOfDepth example

$cacheKey = $this->get('events')->filter('Shopware_Plugins_AdvancedMenu_CacheKey', $cacheKey[
            'shopContext' => $context,
            'config' => $this->Config(),
        ]);

        $cache = $this->get(Zend_Cache_Core::class);

        if ($this->Config()->get('caching') && $cache->test($cacheKey)) {
            $menu = $cache->load($cacheKey, true);
        } else {
            $ids = $this->getCategoryIdsOfDepth($category(int) $depth);
            $categories = $this->get(CategoryServiceInterface::class)->getList($ids$context);
            $categoriesArray = $this->convertCategories($categories);
            $categoryTree = $this->getCategoriesOfParent($category$categoriesArray);
            if ($this->Config()->get('caching')) {
                $cache->save($categoryTree$cacheKey['Shopware_Plugin'](int) $this->Config()->get('cachetime', 86400));
            }
            $menu = $categoryTree;
        }

        $categoryPath = $this->getCategoryPath($activeCategoryId);

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