displayContent(); // $catalog->debug(); class Catalog{ private $_xml; private $_debug; public $id_lang; public $currentTime; public function __construct(){ $this->_xml =""; } public function setContent(){ global $cookie; $dom = new DomDocument(); $sales = SaleCore::getSales("current",0,TRUE,FALSE,TRUE,'position','ASC',FALSE,FALSE,null); // echo "
";
        // print_r($sales);
        // echo "
"; $this->setXml($sales, false); } public function displayContent(){ $this->setContent(); $this->createXML(); header('Content-type: text/xml'); echo $this->_xml; } public function setXml($items, $rss=false){ $this->_xml = ''."\n"; $this->_xml .= ''."\n"; // Catalog $this->_xml .= ''."\n"; //Shop details $this->_xml .= 'Privilège de marque'."\n"; $this->_xml .= 'Toutes les marques des PROS de l\'hôtellerie restauration en ventes privées.'."\n"; $this->_xml .= 'http://www.privilegedemarque.com/'."\n"; $this->_xml .= ''."\n"; foreach ($items as $item){ $this->_xml.=''."\n"; // $this->_xml .= ''.$item->id.''; $this->_xml .= '<![CDATA['.$item->title.']]>'."\n"; $this->_xml .= 'subtitle.']]>'."\n"; $this->_xml .= 'description).']]>'."\n"; $this->_xml .= ''.$item->date_start.''."\n"; $this->_xml .= ''.$item->date_end.''."\n"; $this->_xml .= ''.$item->percent.''."\n"; $this->_xml .= ''._PS_BASE_URL_.'/modules/privatesales/img/'.$item->id.'/current/'.$item->id.'_'.Context::getContext()->language->id.'.jpg'."\n"; $this->_xml .= ''._PS_BASE_URL_.'/modules/privatesales/img/'.$item->id.'/logo/'.$item->id.'_'.Context::getContext()->language->id.'.jpg'."\n"; $this->_xml .= ''.$item->link.''."\n"; $this->_xml.=''."\n"; } $this->_xml .= ''."\n".''; } public function createXML(){ $fp = fopen("fluxVP.xml", "w+"); fwrite($fp, utf8_decode($this->_xml)); fclose($fp); } } ?>