Skip to content

Commit

Permalink
[impr-OpenMage#148] Dispatch a sitemap_cms_pages_generating_before event
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel authored and edannenberg committed Jul 17, 2018
1 parent f8fb965 commit b49cc4e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/code/core/Mage/Sitemap/Model/Sitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,13 @@ public function generateXml()
$changefreq = (string)Mage::getStoreConfig('sitemap/page/changefreq', $storeId);
$priority = (string)Mage::getStoreConfig('sitemap/page/priority', $storeId);
$collection = Mage::getResourceModel('sitemap/cms_page')->getCollection($storeId);
foreach ($collection as $item) {
$pages = new Varien_Object();
$pages->setItems($collection);
Mage::dispatchEvent('sitemap_cms_pages_generating_before', array(
'collection' => $pages,
'store_id' => $storeId
));
foreach ($pages->getItems() as $item) {
$url = $item->getUrl();
if ( $url == $homepage) { $url = ''; }
$xml = sprintf(
Expand Down

0 comments on commit b49cc4e

Please sign in to comment.