adding preheader rss emarsys

This commit is contained in:
Marion Muszynski 2016-07-04 18:20:03 +02:00
parent 45bf5e67b9
commit 95b176601a
2 changed files with 20 additions and 8 deletions

View File

@ -128,18 +128,20 @@ class Catalog
}
$sql_title = '
SELECT `title`
SELECT `title`, `preheader`
FROM `ps_privatesale_newsletter`
WHERE `date_pub` = CURDATE()
AND `version` = "'.$version.'"'
;
$titre_newsletter = Db::getInstance()->getValue($sql_title);
if (empty($titre_newsletter)) {
$titre_newsletter = Configuration::get('PRIVATESALES_TITLE_NEWSLETTER');
$info_newsletter = Db::getInstance()->getRow($sql_title);
if (empty($info_newsletter)) {
$info_newsletter['title'] = Configuration::get('PRIVATESALES_TITLE_NEWSLETTER');
$info_newsletter['preheader'] = '';
}
$this->_xml.='<sect_00>';
$this->_xml .= '<titre><![CDATA['.$titre_newsletter.']]></titre>';
$this->_xml .= '<titre><![CDATA['.$info_newsletter['title'].']]></titre>';
$this->_xml .= '<description><![CDATA['.$info_newsletter['preheader'].']]></description>';
$this->_xml .= '<titre_sunday><![CDATA['.$title_sunday.']]></titre_sunday>';
$this->_xml.='</sect_00>';
@ -147,7 +149,7 @@ class Catalog
$link = new Link();
$category = new Category($item->id_category);
$sale_link = $link->getCategoryLink($category->id, $category->link_rewrite[(int) $id_lang]);
$this->_xml.='<sect_01>';
$this->_xml.='<sect_01>';
$this->_xml .= '<title><![CDATA['.$item->title[(int) $id_lang].']]>|<![CDATA['.$item->reduction.']]></title>';
$this->_xml .= '<description><![CDATA['.$item->description[(int) $id_lang].']]></description>';
$this->_xml .= '<category><![CDATA['.$category->name[(int) $id_lang].']]></category>';

View File

@ -55,6 +55,14 @@ class AdminPrivateSalesNewsletter extends AdminTab {
<div class="clear"></div>
</div>';
echo '<label>'.$this->l('Pre-header:').'</label>
<div class="margin-form">
<div id="title" style="float: left;">
<input type="text" style="width: 500px;" name="preheader" value="'.($this->curnewsletter !== NULL? $this->curnewsletter['preheader']: '').'" />
</div>
<div class="clear"></div>
</div>';
echo '<label>'.$this->l('Date:').'</label>
<div class="margin-form">
<div id="date_pub" style="float: left;">
@ -177,7 +185,8 @@ class AdminPrivateSalesNewsletter extends AdminTab {
"'.pSQL(Tools::getValue('title')).'",
"'.pSQL(Tools::getValue('image_url')).'",
"'.pSQL(Tools::getValue('date_pub')).'",
"'.pSQL(Tools::getValue('version')).'"
"'.pSQL(Tools::getValue('version')).'",
"'.pSQL(Tools::getValue('preheader')).'"
)
');
$id_newsletter = Db::getInstance()->Insert_ID();
@ -198,7 +207,8 @@ class AdminPrivateSalesNewsletter extends AdminTab {
SET `title` = "'.pSQL(Tools::getValue('title')).'",
`image_url` = "'.pSQL(Tools::getValue('image_url')).'",
`date_pub` = "'.pSQL(Tools::getValue('date_pub')).'",
`version` = "'.pSQL(Tools::getValue('version')).'"
`version` = "'.pSQL(Tools::getValue('version')).'",
`preheader` = "'.pSQL(Tools::getValue('preheader')).'"
WHERE `id_newsletter` = '.$id_newsletter.'
');
}