trailer for content

This commit is contained in:
Michael RICOIS 2018-03-20 12:26:10 +01:00
parent d30b3717fd
commit c0e474e35e

View File

@ -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();