diff --git a/modules/googlesitemap/googlesitemap.php b/modules/googlesitemap/googlesitemap.php index 073469c1..a5bc4ae8 100755 --- a/modules/googlesitemap/googlesitemap.php +++ b/modules/googlesitemap/googlesitemap.php @@ -124,6 +124,31 @@ XML; $this->_addSitemapNode($xml, $tmpLink, '0.8', 'weekly'); } + /* Categories Generator */ + if (Module::isInstalled('privatesales')) { + $has_trailers = file_exists(dirname(__FILE__).'/../privatesales/trailer.php'); + $sales = Sale::getSales(true, null, null, 'all'); + foreach($sales as $sale) { + if ($has_trailers) { + $trailers_i18n = array( + 'fr' => 'bande-annonce', + 'en' => 'trailer', + ); + + if (Configuration::get('PS_REWRITING_SETTINGS')) { + if (count($langs) > 1) { + $this->_addSitemapNode($xml, Tools::getShopDomain(TRUE, TRUE).__PS_BASE_URI__.$iso_code.'/'.(isset($trailers_i18n[$iso_code])? $trailers_i18n[$iso_code]: $trailers_i18n['en']).'/'.$sale->id.'-'.Tools::str2url($sale->title[$cookie->id_lang]), '0.8', 'weekly'); + } else { + $this->_addSitemapNode($xml, Tools::getShopDomain(TRUE, TRUE).__PS_BASE_URI__.(isset($trailers_i18n[$iso_code])? $trailers_i18n[$iso_code]: $trailers_i18n['en']).'/'.$sale->id.'-'.Tools::str2url($sale->title[$cookie->id_lang]), '0.8', 'weekly'); + } + } else { + $this->_addSitemapNode($xml, Tools::getShopDomain(TRUE, TRUE).__PS_BASE_URI__.'modules/privatesales/trailer.php?id_sale='.$sale->id, '0.8', 'weekly'); + } + } + } + } + + // Liste des ventes actives $sales = Sale::getSales(true, null, null, 'not_ended'); $products = array();