diff --git a/app/code/community/Creare/CreareSeoSitemap/Block/Sitemap.php b/app/code/community/Creare/CreareSeoSitemap/Block/Sitemap.php index d914589..6281c23 100644 --- a/app/code/community/Creare/CreareSeoSitemap/Block/Sitemap.php +++ b/app/code/community/Creare/CreareSeoSitemap/Block/Sitemap.php @@ -154,15 +154,24 @@ public function buildCategoryTreeHtml($parentId, $isChild = false) { if ($this->sitemapHelper->getConfig('showcategories')) { $categories = Mage::getModel('catalog/category')->getCollection() - ->addAttributeToSelect(array('url', 'name')) + ->addAttributeToSelect(array('name')) ->addAttributeToFilter('is_active', 1) ->addAttributeToFilter('parent_id', array('eq' => $parentId)); + if(!$this->isEnabledFlat()) { + $categories->addAttributeToSelect('url'); + } + $class = ($isChild) ? "subcategories" : "top-level"; $this->categoryTreeHtml .= '