1

I have a problem with my category sitemap.

Like you can see here : http://bizpro.ch/catalog/seo_sitemap/category/ the category list doesn't respect the menu position.

Do you have any idea?

  • Are you using a module for your sitemap generation? In that case you'll need to fix that in the modules source – Sander Mangel Nov 10 '15 at 12:38
  • No,I d'ont use any module. – banu Nov 10 '15 at 12:39
1

You can overwrite the Mage_Catalog_Block_Seo_Sitemap_Category class from your own module (more on that here: http://inchoo.net/magento/overriding-magento-blocks-models-helpers-and-controllers/)

And set the order yourself

class [Namespace]_[Module]_Block_Catalog_Seo_Sitemap_Category extends Mage_Catalog_Block_Seo_Sitemap_Category
{
    protected function _prepareLayout()
    {
        parent::_prepareLayout();
        $helper = Mage::helper('catalog/category');

        // here I've edited the first argument to be `position` instead of default `name`
        $collection = $helper->getStoreCategories('position', true, false);
        $this->setCollection($collection);
        return $this;
    }
}
  • Thanks for your answer. I tried this solution but nothing changed. – banu Nov 10 '15 at 14:36
  • @banu are you sure your rewrite class is used? (just to be sure) – Sander Mangel Nov 10 '15 at 14:37
  • I think that it's ok but to be sur I modified directly Mage/Catalog/Seo/Sitemap/Category.php but nothing changed.(I have a backup of course) – banu Nov 10 '15 at 20:36
  • @banu I'll test this tomorrow and report back – Sander Mangel Nov 10 '15 at 21:08
  • @banu can you print the collection query? Should be var_dump((string)$collection->getSelect()); – Sander Mangel Nov 11 '15 at 10:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.