Merge branch 'ticket-12487-HTTPS3'

This commit is contained in:
Marion Muszynski 2017-04-10 16:31:37 +02:00
commit d8515e1fca

View File

@ -17,17 +17,17 @@ $catalog = new Catalog();
$catalog->displayContent($id_lang);
// $catalog->debug();
class Catalog
class Catalog
{
private $_xml;
private $_debug;
public $id_lang;
public $currentTime;
public function __construct(){
$this->_xml ="";
}
public function setContent($id_lang)
{
global $cookie;
@ -38,13 +38,13 @@ class Catalog
} else if ($id_lang == 3) {
$site_version = 'es';
}
if (Tools::getValue('future') && Tools::getValue('future') == 1)
$sales = Sale::getSales(TRUE, NULL, NULL, TRUE, FALSE, Configuration::get('PRIVATESALES_SHOW_PUBLIC'), '`date_start` DESC', NULL, $filter_type, $site_version);
else
$sales = Sale::getSales(TRUE, NULL, NULL, 'current', FALSE, Configuration::get('PRIVATESALES_SHOW_PUBLIC'), '`date_start` DESC', NULL, $filter_type, $site_version);
foreach ($sales as $sale) {
foreach ($sales as $sale) {
$sql = 'SELECT value FROM '._DB_PREFIX_.'privatesale_extrafield_sale WHERE id_field = 2 AND id_lang = '.(int) $id_lang.' AND id_sale = ' . $sale->id;
if ($value = Db::getInstance()->getValue($sql)){
$sale->reduction = $value;
@ -55,7 +55,7 @@ class Catalog
$this->setXml($sales, false, $id_lang);
}
public function displayContent($id_lang)
{
$this->setContent($id_lang);
@ -65,19 +65,19 @@ class Catalog
public function setXml($items, $rss=false, $id_lang){
$this->_xml = '<?xml version="1.0" encoding="UTF-8" ?>';
// Catalog
$this->_xml .= '<catalogue>';
//Shop details
$this->_xml .= '<infos_boutique>';
$this->_xml .= '<logo>http://www.bebeboutik.com/img/logo.png</logo>';
$this->_xml .= '<logo>https://www.bebeboutik.com/img/logo.png</logo>';
$this->_xml .= '<nom>bebeboutik.com</nom>';
if (Tools::getValue('partenaire')
if (Tools::getValue('partenaire')
&& Tools::getValue('partenaire') == "family_deal") {
$this->_xml .= '<url><![CDATA[http://www.bebeboutik.com/invite/MjAxMy0xMC0y=02bj5yapRXdvJWZiVmYAxWYlRWL5xWatFmZ&lp=mosaique-enfant]]></url>';
$this->_xml .= '<url><![CDATA[https://www.bebeboutik.com/invite/MjAxMy0wNC0z=02bj5yapRXdvJWZiVmYANWasJWdwtCdjFGdu92Y&lp=mosaique-enfant?utm_source=publicidees&utm_medium=CPL]]></url>';
} else {
$this->_xml .= '<url>www.bebeboutik.com</url>';
$this->_xml .= '<url>https://www.bebeboutik.com</url>';
}
$this->_xml .= '</infos_boutique>';
@ -90,13 +90,13 @@ class Catalog
$this->_xml .= '<date_debut>'.$item->date_start.'</date_debut>';
$this->_xml .= '<date_fin>'.$item->date_end.'</date_fin>';
$this->_xml .= '<reduction>'.$item->reduction.'</reduction>';
$this->_xml .= '<image_vente>http://www.bebeboutik.com/modules/privatesales/img/'.$item->id.'/liston_'.(int) $id_lang.'.jpg</image_vente>';
$this->_xml .= '<image_vente>https://www.bebeboutik.com/modules/privatesales/img/'.$item->id.'/liston_'.(int) $id_lang.'.jpg</image_vente>';
$this->_xml.='</vente>';
}
$this->_xml .= '</catalogue>';
}
}