Hi there,
For a multistore magento webshop I have an issue with an (auto) generated parent sitemap. It is generated at example.com/sitemap/. See: http://snag.gy/VB7S9.jpg
I would like to have the HTML sitemap on this url instead of a parent sitemap of both store views. Is there a solutuion for this?
Thanks in advance!
In order to make HTML list you need to list all URL's of your catalog. You can get all URL's of category and product by using below code.
//Category List $collection = Mage::getModel('catalog/category') ->getCollection() ->addAttributeToSelect('*') ->addIsActiveFilter(); foreach($collection as $category) { echo $category->getUrl() . "<br/>"; } //Products List $collection = Mage::getModel('catalog/product') ->getCollection() ->addAttributeToSelect('*') ->addAttributeToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED) ->addAttributeToFilter('visibility', array( Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH, Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG )); foreach($collection as $product) { echo $product->getProductUrl() . "<br/>"; }
Hope it helps you
Hi Grav,
Thx for the code, but there is a standard magento function which does this automaticly, see:
However it seems that this is not working in a multistore environment, and on example.com/sitemap/ is a parent sitemap displayed, this is not desirable (see above screenshot).
Thanks for the answer anyway.
Ah my misstake, made the folder sitemap