Skip to content

Commit

Permalink
Merge pull request #8 from rbrown/sitemap_changes
Browse files Browse the repository at this point in the history
Add sitemap generating events from 1.9.0.1
  • Loading branch information
adampmoss committed Oct 29, 2014
2 parents 8764c1a + a3a0ae7 commit a8e5cff
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions app/code/community/Creare/CreareSeoCore/Model/Sitemap/Sitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
'<url><loc>%s</loc><lastmod>%s</lastmod><changefreq>%s</changefreq><priority>%.1f</priority></url>',
htmlspecialchars($baseUrl . $item->getUrl()),
Expand All @@ -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(
'<url><loc>%s</loc><lastmod>%s</lastmod><changefreq>%s</changefreq><priority>%.1f</priority></url>',
htmlspecialchars($baseUrl . $item->getUrl()),
Expand Down

0 comments on commit a8e5cff

Please sign in to comment.