diff --git a/app/code/community/Creare/CreareSeoCore/Model/Sitemap/Sitemap.php b/app/code/community/Creare/CreareSeoCore/Model/Sitemap/Sitemap.php index 73baec1..723d3ed 100644 --- a/app/code/community/Creare/CreareSeoCore/Model/Sitemap/Sitemap.php +++ b/app/code/community/Creare/CreareSeoCore/Model/Sitemap/Sitemap.php @@ -29,7 +29,12 @@ public function generateXml() $changefreq = (string)Mage::getStoreConfig('sitemap/category/changefreq', $storeId); $priority = (string)Mage::getStoreConfig('sitemap/category/priority', $storeId); $collection = Mage::getResourceModel('sitemap/catalog_category')->getCollection($storeId); - foreach ($collection as $item) { + $categories = new Varien_Object(); + $categories->setItems($collection); + Mage::dispatchEvent('sitemap_categories_generating_before', array( + 'collection' => $categories + )); + foreach ($categories->getItems() as $item) { $xml = sprintf( '%s%s%s%.1f', htmlspecialchars($baseUrl . $item->getUrl()), @@ -47,7 +52,12 @@ public function generateXml() $changefreq = (string)Mage::getStoreConfig('sitemap/product/changefreq', $storeId); $priority = (string)Mage::getStoreConfig('sitemap/product/priority', $storeId); $collection = Mage::getResourceModel('sitemap/catalog_product')->getCollection($storeId); - foreach ($collection as $item) { + $products = new Varien_Object(); + $products->setItems($collection); + Mage::dispatchEvent('sitemap_products_generating_before', array( + 'collection' => $products + )); + foreach ($products->getItems() as $item) { $xml = sprintf( '%s%s%s%.1f', htmlspecialchars($baseUrl . $item->getUrl()),