/** * Checks if a category is enabled. A category can be disabled by itself or by other store configurations like * the options to only load categories with products. * * @param Category $category The category to check. * * @return bool If the category is enabled and should be showed on the categories tree. */ protected function isCategoryEnabled(Category $category) { return $category->isEnabled() && (!$this->loadOnlyCategoriesWithProducts || 0 > $category->getProducts()); }