Compare commits
46 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
641f41579c | ||
|
4bab732b78 | ||
|
f72af32b40 | ||
|
78f7573bdb | ||
|
c166f3c988 | ||
|
6a95ebf079 | ||
|
a2a082a8cf | ||
|
07e0e7d18a | ||
|
359bbffc7f | ||
|
95320c6e84 | ||
|
866b714acc | ||
|
4e86171ada | ||
|
d4e60bacee | ||
|
d6d55f681c | ||
|
d29ac65cee | ||
|
42b9247f65 | ||
|
0d80c44cab | ||
|
ab3695e7a8 | ||
|
747b957f98 | ||
|
f4e4dedd86 | ||
|
4248ceb595 | ||
|
349b7e7cb7 | ||
|
ea75b02efa | ||
|
fcf69fedec | ||
|
8d7ccb4d3f | ||
|
b53ac563ad | ||
|
ad77e3ce49 | ||
|
368d82307c | ||
|
41f45d1404 | ||
|
f7857a3f40 | ||
|
e54b05cd03 | ||
|
8c40caedf8 | ||
|
719b0aa743 | ||
|
ed3db565e6 | ||
|
2df8a54ba9 | ||
|
b24091f295 | ||
|
ddbbaa9669 | ||
|
fa6bcaf660 | ||
|
cbbd5de2f6 | ||
|
bb97c4685f | ||
|
1a3d4e4316 | ||
|
0d662aa3c3 | ||
|
b15c7265df | ||
|
c677052972 | ||
|
c90afca56b | ||
|
c63ff9c529 |
177
modules/advslider/advslider.php
Normal file
177
modules/advslider/advslider.php
Normal file
@ -0,0 +1,177 @@
|
||||
<?php
|
||||
|
||||
if (!defined('_CAN_LOAD_FILES_'))
|
||||
exit;
|
||||
|
||||
include_once(dirname(__FILE__) . '/classes/AdvSlide.php');
|
||||
|
||||
class AdvSlider extends Module
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'advslider';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.0';
|
||||
$this->author = 'Antadis';
|
||||
$this->need_instance = 0;
|
||||
|
||||
$this->bootstrap = true;
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Slider avancé');
|
||||
$this->description = $this->l('Gestion du slider avec spécificités PrivilegeDeMarque');
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
$sql = array();
|
||||
|
||||
$sql[] =
|
||||
'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'advslider` (
|
||||
`id_slide` int(10) unsigned NOT NULL auto_increment,
|
||||
`position` INT(11) UNSIGNED NOT NULL default 0,
|
||||
`active` INT(11) UNSIGNED NOT NULL default 1,
|
||||
`light` INT(11) UNSIGNED NOT NULL default 1,
|
||||
PRIMARY KEY (`id_slide`)
|
||||
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8';
|
||||
|
||||
$sql[] =
|
||||
'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'advslider_lang` (
|
||||
`id_slide` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`title` varchar(255) NOT NULL,
|
||||
`subtitle` varchar(255) NOT NULL,
|
||||
`label` varchar(255) NOT NULL,
|
||||
`url` varchar(255),
|
||||
`description` TEXT,
|
||||
PRIMARY KEY (`id_slide`,`id_lang`)
|
||||
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8';
|
||||
|
||||
$sql[] =
|
||||
'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'advslider_shop` (
|
||||
`id_slide` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_shop` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_slide`, `id_shop`)
|
||||
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8';
|
||||
|
||||
$sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'advslider_group` (
|
||||
`id_slide` int(11) NOT NULL,
|
||||
`id_group` int(11) NOT NULL
|
||||
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8';
|
||||
|
||||
$sql[] = "ALTER TABLE `ps_advslider` ADD `start_at` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `light`,
|
||||
ADD `end_at` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `start_at`;";
|
||||
|
||||
foreach ($sql as $_sql) {
|
||||
Db::getInstance()->Execute($_sql);
|
||||
}
|
||||
|
||||
$tab = new Tab();
|
||||
$tab->class_name = 'AdminAdvSlider';
|
||||
$tab->id_parent = Tab::getCurrentParentId();
|
||||
$tab->module = $this->name;
|
||||
$languages = Language::getLanguages();
|
||||
foreach ($languages as $language) {
|
||||
$tab->name[$language['id_lang']] = 'Slider';
|
||||
}
|
||||
|
||||
$img_dir = _PS_IMG_DIR_ . 'slider';
|
||||
$folder = is_dir($img_dir);
|
||||
if (!$folder) {
|
||||
$folder = mkdir($img_dir, 0755, true);
|
||||
}
|
||||
|
||||
return parent::install()
|
||||
&& $tab->add()
|
||||
&& $this->registerHook('displaySlider')
|
||||
&& $this->registerHook('displayHeader')
|
||||
&& $this->registerHook('actionRefreshSlider')
|
||||
&& $folder;
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
$sql = 'DROP TABLE IF EXISTS
|
||||
`' . _DB_PREFIX_ . 'advslider_lang`,
|
||||
`' . _DB_PREFIX_ . 'advslider_shop`,
|
||||
`' . _DB_PREFIX_ . 'advslider`,
|
||||
`' . _DB_PREFIX_ . 'advslider_group`
|
||||
';
|
||||
|
||||
Db::getInstance()->Execute($sql);
|
||||
|
||||
$idTab = Tab::getIdFromClassName('AdminAdvSlider');
|
||||
if ($idTab) {
|
||||
$tab = new Tab($idTab);
|
||||
$tab->delete();
|
||||
}
|
||||
|
||||
return parent::uninstall();
|
||||
}
|
||||
|
||||
public function getHookController($hook_name)
|
||||
{
|
||||
// Include the controller file
|
||||
require_once(dirname(__FILE__).'/controllers/hook/'. $hook_name.'.php');
|
||||
|
||||
// Build dynamically the controller name
|
||||
$controller_name = $this->name.$hook_name.'Controller';
|
||||
|
||||
// Instantiate controller
|
||||
$controller = new $controller_name($this, __FILE__, $this->_path);
|
||||
|
||||
// Return the controller
|
||||
return $controller;
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
$ajax_hook = Tools::getValue('ajax_hook');
|
||||
if ($ajax_hook != '') {
|
||||
$ajax_method = 'hook'.ucfirst($ajax_hook);
|
||||
if (method_exists($this, $ajax_method)) {
|
||||
die($this->{$ajax_method}(array()));
|
||||
}
|
||||
}
|
||||
|
||||
$controller = $this->getHookController('getContent');
|
||||
return $controller->run();
|
||||
}
|
||||
|
||||
public function hookDisplaySlider($params)
|
||||
{
|
||||
$cacheEnabled = false;
|
||||
|
||||
if (!$cacheEnabled || !$this->isCached('advslider.tpl', $this->getCacheId())) {
|
||||
$slides = AdvSlide::getSlides();
|
||||
|
||||
if (!$slides) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->smarty->assign('slides', $slides);
|
||||
|
||||
return $this->display(__FILE__, 'advslider.tpl');
|
||||
}
|
||||
|
||||
return $this->display(__FILE__, 'advslider.tpl', $this->getCacheId());
|
||||
}
|
||||
|
||||
public function hookHeader($params)
|
||||
{
|
||||
$jsFiles = $this->context->controller->js_files;
|
||||
foreach($jsFiles as $jsFile) {
|
||||
if(strpos($jsFile, 'flexslider') !== false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$this->context->controller->addJS($this->_path.'js/flexslider.js');
|
||||
}
|
||||
|
||||
public function hookActionRefreshSlider()
|
||||
{
|
||||
$this->_clearCache('advslider');
|
||||
}
|
||||
|
||||
}
|
253
modules/advslider/classes/AdvSlide.php
Normal file
253
modules/advslider/classes/AdvSlide.php
Normal file
@ -0,0 +1,253 @@
|
||||
<?php
|
||||
|
||||
class AdvSlide extends ObjectModel
|
||||
{
|
||||
public $id_slide;
|
||||
public $position;
|
||||
public $active;
|
||||
|
||||
public $title;
|
||||
public $subtitle;
|
||||
public $label;
|
||||
public $url;
|
||||
public $description;
|
||||
public $light;
|
||||
public $start_at;
|
||||
public $end_at;
|
||||
|
||||
public static $definition = array(
|
||||
'table' => 'advslider',
|
||||
'primary' => 'id_slide',
|
||||
'multilang' => TRUE,
|
||||
'fields' => array(
|
||||
'id_slide' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
|
||||
'position' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
|
||||
'active' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
|
||||
'light' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
|
||||
'start_at' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
'end_at' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
|
||||
// Lang fields
|
||||
'title' => array('type' => self::TYPE_STRING, 'lang' => TRUE, 'validate' => 'isGenericName', 'size' => 255),
|
||||
'subtitle' => array('type' => self::TYPE_HTML, 'lang' => TRUE, 'validate' => 'isCleanHtml', 'size' => 255),
|
||||
'label' => array('type' => self::TYPE_STRING, 'lang' => TRUE, 'validate' => 'isGenericName', 'size' => 255),
|
||||
'url' => array('type' => self::TYPE_STRING, 'lang' => TRUE, 'validate' => 'isUrl', 'size' => 255),
|
||||
'description' => array('type' => self::TYPE_STRING, 'lang' => TRUE, 'validate' => 'isCleanHtml')
|
||||
),
|
||||
'associations' => array(
|
||||
'groups' => array('type' => self::HAS_MANY, 'field' => 'id_group', 'object' => 'Group', 'association' => 'advslider_group'),
|
||||
),
|
||||
);
|
||||
|
||||
public function __construct($id = NULL, $id_lang = NULL, $id_shop = NULL)
|
||||
{
|
||||
parent::__construct($id, $id_lang, $id_shop);
|
||||
|
||||
$this->image_dir = _PS_IMG_DIR_ . 'slider/';
|
||||
|
||||
if (!file_exists(_PS_TMP_IMG_DIR_)) {
|
||||
mkdir(_PS_TMP_IMG_DIR_, 755);
|
||||
}
|
||||
}
|
||||
|
||||
public function add($null_values = false, $autodate = true)
|
||||
{
|
||||
$result = parent::add($null_values, $autodate);
|
||||
Hook::exec('actionRefreshSlider');
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function update($null_values = FALSE)
|
||||
{
|
||||
$result = parent::update($null_values);
|
||||
Hook::exec('actionRefreshSlider');
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function updateGroups($data)
|
||||
{
|
||||
$dataToInsert = array();
|
||||
if (count($data) > 0) {
|
||||
// Reset
|
||||
Db::getInstance()->delete('advslider_group', 'id_slide='.(int)$this->id);
|
||||
// Prepare update
|
||||
foreach($data as $k => $v) {
|
||||
$dataToInsert[] = array(
|
||||
'id_slide' => $this->id,
|
||||
'id_group' => $v,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (count($dataToInsert) > 0) {
|
||||
Db::getInstance()->insert('advslider_group', $dataToInsert);
|
||||
}
|
||||
}
|
||||
|
||||
public function delete($null_values = FALSE)
|
||||
{
|
||||
$result = parent::delete($null_values);
|
||||
Hook::exec('actionRefreshSlider');
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function getSlides()
|
||||
{
|
||||
$context = Context::getContext();
|
||||
|
||||
$sql = 'SELECT * FROM `'._DB_PREFIX_.'advslider` adv
|
||||
JOIN `'._DB_PREFIX_.'advslider_lang` advl ON (adv.`id_slide` = advl.`id_slide` AND id_lang='. (int)$context->language->id .')
|
||||
WHERE adv.`active` = 1';
|
||||
|
||||
// Check user group
|
||||
if (Configuration::get('ADVSLIDER_RESTRICT_GROUP')) {
|
||||
$groups = Customer::getGroupsStatic($context->customer->id);
|
||||
if ($context->customer->logged == 0) {
|
||||
$groups = array(Configuration::get('ADVSLIDER_DEFAULT_GROUP'));
|
||||
}
|
||||
|
||||
$sql.= ' AND adv.`id_slide` IN (SELECT `id_slide` FROM `'._DB_PREFIX_.'advslider_group` ag WHERE ag.id_group IN('.join(',', $groups).'))';
|
||||
}
|
||||
|
||||
// Check date
|
||||
if (Configuration::get('ADVSLIDER_RESTRICT_DATE')) {
|
||||
$sql.= ' AND adv.`start_at` < NOW() AND adv.`end_at` > NOW() ';
|
||||
}
|
||||
|
||||
$sql.= ' ORDER BY `position` ASC';
|
||||
|
||||
$slides = Db::getInstance()->executeS($sql);
|
||||
|
||||
// Remove slider without image
|
||||
if (count($slides) > 0) {
|
||||
foreach($slides as $key => $slide) {
|
||||
if(!file_exists(_PS_IMG_DIR_ . 'slider/' . $slide['id_slide'] . '.jpg')) {
|
||||
unset($slides[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $slides;
|
||||
}
|
||||
|
||||
public static function getGroupsFormatted($id_slide)
|
||||
{
|
||||
$groups = array();
|
||||
$result = Db::getInstance()->executeS('SELECT `id_group` FROM `'._DB_PREFIX_.'advslider_group` WHERE `id_slide`=');
|
||||
if (count($result) > 0) {
|
||||
foreach($result as $r) {
|
||||
$groups[] = $r['id_group'];
|
||||
}
|
||||
}
|
||||
|
||||
return $groups;
|
||||
}
|
||||
|
||||
public function getGroups()
|
||||
{
|
||||
$groups = Db::getInstance()->executeS('SELECT `id_group` FROM `'._DB_PREFIX_.'advslider_group` WHERE `id_slide`='.(int)$this->id);
|
||||
|
||||
return $groups;
|
||||
}
|
||||
|
||||
public function deleteImage($force_delete = false)
|
||||
{
|
||||
if (!$this->id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$imgToDelete = Tools::getValue('imgName', false);
|
||||
|
||||
if ($imgToDelete === false) {
|
||||
return parent::deleteImage($force_delete = false);
|
||||
}
|
||||
|
||||
if ($force_delete || !$this->hasMultishopEntries()) {
|
||||
/* Deleting object images and thumbnails (cache) */
|
||||
|
||||
if ($this->image_dir) {
|
||||
if (file_exists($this->image_dir.$this->id.'-'.$imgToDelete.'.'.$this->image_format)
|
||||
&& !unlink($this->image_dir.$this->id.'-'.$imgToDelete.'.'.$this->image_format)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (file_exists(_PS_TMP_IMG_DIR_.$this->def['table'].'_'.$this->id.'-'.$imgToDelete.'.'.$this->image_format)
|
||||
&& !unlink(_PS_TMP_IMG_DIR_.$this->def['table'].'_'.$this->id.'-'.$imgToDelete.'.'.$this->image_format)) {
|
||||
return false;
|
||||
}
|
||||
if (file_exists(_PS_TMP_IMG_DIR_.$this->def['table'].'_mini_'.$this->id.'-'.$imgToDelete.'.'.$this->image_format)
|
||||
&& !unlink(_PS_TMP_IMG_DIR_.$this->def['table'].'_mini_'.$this->id.'-'.$imgToDelete.'.'.$this->image_format)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function cleanPositions()
|
||||
{
|
||||
return Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'advslider`
|
||||
SET `position`= `position` - 1
|
||||
WHERE `id_slide` = '.(int)$this->id_slide.'
|
||||
AND `position` > '.(int)$this->position);
|
||||
}
|
||||
|
||||
public function updatePosition($way, $position)
|
||||
{
|
||||
$sql = 'SELECT `position`, `id_slide`
|
||||
FROM `'._DB_PREFIX_.'advslider`
|
||||
ORDER BY `position` ASC';
|
||||
if (!$res = Db::getInstance()->executeS($sql))
|
||||
return false;
|
||||
|
||||
foreach ($res as $row)
|
||||
if ((int)$row['id_slide'] == (int)$this->id_slide)
|
||||
$moved_row = $row;
|
||||
|
||||
if (!isset($moved_row) || !isset($position))
|
||||
return false;
|
||||
|
||||
// < and > statements rather than BETWEEN operator
|
||||
// since BETWEEN is treated differently according to databases
|
||||
$res = Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'advslider`
|
||||
SET `position`= `position` '.($way ? '- 1' : '+ 1').'
|
||||
WHERE `position`
|
||||
'.($way
|
||||
? '> '.(int)$moved_row['position'].' AND `position` <= '.(int)$position
|
||||
: '< '.(int)$moved_row['position'].' AND `position` >= '.(int)$position)
|
||||
)
|
||||
&& Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'advslider`
|
||||
SET `position` = '.(int)$position.'
|
||||
WHERE `id_slide`='.(int)$moved_row['id_slide']
|
||||
);
|
||||
$this->refreshPositions();
|
||||
|
||||
Hook::exec('actionRefreshSlider');
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function refreshPositions()
|
||||
{
|
||||
$sql = 'SELECT `id_slide`
|
||||
FROM `'._DB_PREFIX_.'advslider`
|
||||
ORDER BY `position` ASC';
|
||||
if (!$blocks = Db::getInstance()->executeS($sql))
|
||||
return false;
|
||||
|
||||
$pos=0;
|
||||
foreach ($blocks as $block) {
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'advslider`
|
||||
SET `position` = '.(int)$pos.'
|
||||
WHERE `id_slide`='.(int)$block['id_slide']);
|
||||
$pos++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
395
modules/advslider/controllers/admin/AdminAdvSlider.php
Normal file
395
modules/advslider/controllers/admin/AdminAdvSlider.php
Normal file
@ -0,0 +1,395 @@
|
||||
<?php
|
||||
include_once dirname(__FILE__).'/../../classes/AdvSlide.php';
|
||||
|
||||
class AdminAdvSliderController extends ModuleAdminController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->table = 'advslider';
|
||||
$this->className = 'AdvSlide';
|
||||
$this->identifier = 'id_slide';
|
||||
$this->lang = true;
|
||||
$this->deleted = false;
|
||||
$this->bootstrap = true;
|
||||
$this->fieldImageSettings = array(
|
||||
'name' => 'image',
|
||||
'dir' => 'slider'
|
||||
);
|
||||
$this->position_identifier = 'id_slide';
|
||||
$this->_defaultOrderBy = 'position';
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->actions = array('edit', 'delete');
|
||||
|
||||
$this->fields_list = array(
|
||||
'id_slide' => array(
|
||||
'title' => 'ID',
|
||||
'width' => 25
|
||||
),
|
||||
'image_desktop' => array(
|
||||
'title' => $this->module->l('Image'),
|
||||
'image' => $this->fieldImageSettings['dir'],
|
||||
'width' => 75
|
||||
),
|
||||
'title' => array(
|
||||
'title' => $this->module->l('Titre'),
|
||||
),
|
||||
'active' => array(
|
||||
'title' => $this->module->l('Actif'),
|
||||
'type' => 'bool',
|
||||
),
|
||||
'start_at' => array(
|
||||
'title' => $this->module->l('Début'),
|
||||
),
|
||||
'end_at' => array(
|
||||
'title' => $this->module->l('Fin'),
|
||||
),
|
||||
'url' => array(
|
||||
'title' => $this->module->l('Url'),
|
||||
'width' => 45,
|
||||
),
|
||||
'position' => array(
|
||||
'title' => $this->l('Position'),
|
||||
'align' => 'center',
|
||||
'position' => 'position',
|
||||
'filter_key' => 'a!position'
|
||||
),
|
||||
);
|
||||
|
||||
if (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_ALL){
|
||||
$this->_join .= 'JOIN `'._DB_PREFIX_.'advslider_shop` as ashop ON a.`id_slide` = ashop.`id_slide` AND ashop.`id_shop` IN ('.implode(', ', Shop::getContextListShopID()).') ';
|
||||
$this->_group .= 'GROUP BY ashop.`id_slide`';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function initPageHeaderToolbar()
|
||||
{
|
||||
parent::initPageHeaderToolbar();
|
||||
|
||||
if ($this->display != 'edit' && $this->display != 'add') {
|
||||
$this->page_header_toolbar_btn['new_link'] = array(
|
||||
'href' => self::$currentIndex.'&id_parent='.(int)Tools::getValue('id_slide').'&addadvslider&token='.$this->token,
|
||||
'desc' => $this->l('Ajouter une nouvelle slide', NULL, NULL, FALSE),
|
||||
'icon' => 'process-icon-new'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function renderView()
|
||||
{
|
||||
return $this->renderList();
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
$this->fields_form = array(
|
||||
'tinymce' => TRUE,
|
||||
'legend' => array(
|
||||
'title' => $this->className,
|
||||
),
|
||||
'submit' => array(
|
||||
'name' => 'submitAdvSlider',
|
||||
'title' => $this->l('Save'),
|
||||
),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Titre'),
|
||||
'name' => 'title',
|
||||
'lang' => TRUE,
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Sous-titre'),
|
||||
'name' => 'subtitle',
|
||||
'lang' => TRUE,
|
||||
),
|
||||
array(
|
||||
'type' => 'switch',
|
||||
'label' => $this->l('Activé'),
|
||||
'name' => 'active',
|
||||
'required' => FALSE,
|
||||
'is_bool' => TRUE,
|
||||
'default' => 1,
|
||||
'values' => array(
|
||||
array(
|
||||
'id' => 'active_on',
|
||||
'value' => 1,
|
||||
'label' => $this->l('Enabled')
|
||||
),
|
||||
array(
|
||||
'id' => 'active_off',
|
||||
'value' => 0,
|
||||
'label' => $this->l('Disabled')
|
||||
)
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'datetime',
|
||||
'label' => $this->l('Date de début'),
|
||||
'name' => 'start_at',
|
||||
'lang' => false,
|
||||
),
|
||||
array(
|
||||
'type' => 'datetime',
|
||||
'label' => $this->l('Date de fin'),
|
||||
'name' => 'end_at',
|
||||
'lang' => false,
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'label' => $this->l('Groupe(s) d\'utilisateur'),
|
||||
'name' => 'groups',
|
||||
'values' => array(
|
||||
'query' => array(
|
||||
array('id_group' => 3, 'name' => 'Particulier'),
|
||||
array('id_group' => 4, 'name' => 'Pro'),
|
||||
),
|
||||
'id' => 'id_group',
|
||||
'name' => 'name',
|
||||
),
|
||||
'expand' => array(
|
||||
'default' => 'show',
|
||||
'show' => array('text' => $this->l('show'), 'icon' => 'plus-sign-alt'),
|
||||
'hide' => array('text' => $this->l('hide'), 'icon' => 'minus-sign-alt')
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'switch',
|
||||
'label' => $this->l('Texte foncé ?'),
|
||||
'name' => 'light',
|
||||
'required' => FALSE,
|
||||
'is_bool' => TRUE,
|
||||
'default' => 1,
|
||||
'values' => array(
|
||||
array(
|
||||
'id' => 'light_on',
|
||||
'value' => 1,
|
||||
'label' => $this->l('Enabled')
|
||||
),
|
||||
array(
|
||||
'id' => 'light_off',
|
||||
'value' => 0,
|
||||
'label' => $this->l('Disabled')
|
||||
)
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Label lien'),
|
||||
'name' => 'label',
|
||||
'lang' => TRUE
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Lien'),
|
||||
'name' => 'url',
|
||||
'lang' => TRUE
|
||||
),
|
||||
array(
|
||||
'type' => 'textarea',
|
||||
'label' => $this->l('Description'),
|
||||
'name' => 'description',
|
||||
'autoload_rte' => TRUE,
|
||||
'lang' => TRUE
|
||||
),
|
||||
array(
|
||||
'type' => 'shop',
|
||||
'label' => $this->l('Shop'),
|
||||
'form_group_class' => 'fieldhide input_association',
|
||||
'name' => 'checkBoxShopAsso_advslider'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$obj = $this->loadObject(true);
|
||||
|
||||
$selectedGroups = array();
|
||||
|
||||
$image = false;
|
||||
$image_url = '';
|
||||
$image_size = '';
|
||||
|
||||
$image_mobile = false;
|
||||
$image_url_mobile = '';
|
||||
$image_size_mobile = '';
|
||||
|
||||
if($obj) {
|
||||
// Groupes
|
||||
$selectedGroups = $obj->getGroups();
|
||||
if (count($selectedGroups) > 0) {
|
||||
foreach ($selectedGroups as $id) {
|
||||
$this->fields_value['groups_'.$id['id_group']] = 'on';
|
||||
}
|
||||
}
|
||||
|
||||
// Images
|
||||
$image = _PS_IMG_DIR_ . 'slider/' . $obj->id.'.jpg';
|
||||
$image_url = ImageManager::thumbnail($image, $this->table.'_'.(int)$obj->id.'.'.$this->imageType, 350, $this->imageType, true, true);
|
||||
$image_size = file_exists($image) ? filesize($image) / 1000 : false;
|
||||
|
||||
$image_mobile = _PS_IMG_DIR_ . 'slider/' . $obj->id.'-mobile.jpg';
|
||||
$image_url_mobile = ImageManager::thumbnail($image_mobile, $this->table.'_'.(int)$obj->id.'-image_mobile.'.$this->imageType, 350, $this->imageType, true, true);
|
||||
$image_size_mobile = file_exists($image_mobile) ? filesize($image_mobile) / 1000 : false;
|
||||
}
|
||||
|
||||
$this->fields_form['input'][] = array(
|
||||
'type' => 'file',
|
||||
'label' => $this->l('Image'),
|
||||
'desc' => $this->l('Image - type: jpg,png - size: 940 x 300 px'),
|
||||
'name' => 'image',
|
||||
'display_image' => true,
|
||||
'lang' => true,
|
||||
'required' => true,
|
||||
'image' => $image_url,
|
||||
'size' => $image_size,
|
||||
'delete_url' => self::$currentIndex.'&'.$this->identifier.'='.$this->object->id.'&token='.$this->token.'&deleteImage=1'
|
||||
);
|
||||
|
||||
$this->fields_form['input'][] = array(
|
||||
'type' => 'file',
|
||||
'label' => $this->l('Image Mobile'),
|
||||
'desc' => $this->l('Image - type: jpg,png - size: 300 x 200 px'),
|
||||
'name' => 'image_mobile',
|
||||
'display_image' => true,
|
||||
'lang' => true,
|
||||
'required' => true,
|
||||
'image' => $image_url_mobile,
|
||||
'size' => $image_size_mobile,
|
||||
'delete_url' => self::$currentIndex.'&'.$this->identifier.'='.$this->object->id.'&token='.$this->token.'&deleteImage=1&imgName=image_mobile'
|
||||
);
|
||||
|
||||
return parent::renderForm();
|
||||
}
|
||||
|
||||
protected function copyFromPost(&$object, $table)
|
||||
{
|
||||
parent::copyFromPost($object, $table);
|
||||
|
||||
if(Shop::isFeatureActive()) {
|
||||
$object->id_shop_list = array();
|
||||
foreach (Tools::getValue('checkBoxShopAsso_advslider') as $id_shop => $value) {
|
||||
$object->id_shop_list[] = $id_shop;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (Tools::getValue('deleteImage')) {
|
||||
$this->processForceDeleteImage();
|
||||
$this->refreshPreview();
|
||||
}
|
||||
|
||||
parent::postProcess();
|
||||
|
||||
$obj = $this->loadObject(TRUE);
|
||||
|
||||
// Groupes
|
||||
$groupsData = array();
|
||||
foreach ($_POST as $pKey => $pValue) {
|
||||
$groupKey = 'groups_';
|
||||
if (substr($pKey, 0, strlen($groupKey)) == $groupKey && $pValue == 'on') {
|
||||
$groupsData[] = substr($pKey, strlen($groupKey));
|
||||
}
|
||||
}
|
||||
if (count($groupsData) > 0) {
|
||||
$obj->updateGroups($groupsData);
|
||||
}
|
||||
|
||||
// Images
|
||||
$images = array(
|
||||
'image_mobile' => 'mobile',
|
||||
);
|
||||
foreach($images as $imageName => $suffix) {
|
||||
if(isset($_FILES[$imageName]) && !empty($_FILES[$imageName]['tmp_name'])) {
|
||||
$fileTemp = $_FILES[$imageName]['tmp_name'];
|
||||
$fileParts = pathinfo($_FILES[$imageName]['name']);
|
||||
$extension = $fileParts['extension'];
|
||||
|
||||
if(file_exists(_PS_IMG_DIR_.'slider/'.$obj->id.'-'.$suffix.'.'.$extension)) {
|
||||
unlink(_PS_IMG_DIR_.'slider/'.$obj->id.'-'.$suffix.'.'.$extension);
|
||||
}
|
||||
|
||||
if(in_array($extension, array('jpg', 'png'))) {
|
||||
$res = move_uploaded_file($fileTemp, _PS_IMG_DIR_.'slider/'.$obj->id.'-'.$suffix.'.'.$extension);
|
||||
if(!$res) {
|
||||
$this->errors[] = sprintf(Tools::displayError('An error occured during upload of file %s'), $obj->id.'.'.$extension);
|
||||
}
|
||||
else {
|
||||
if($extension == 'png') {
|
||||
ImageManager::resize(_PS_IMG_DIR_.'slider/'.$obj->id.'-'.$suffix.'.'.$extension, _PS_IMG_DIR_.'slider/'.$obj->id.'-'.$suffix.'.jpg');
|
||||
}
|
||||
$this->confirmations[] = sprintf($this->l('File %s has been uploaded'), $obj->id.'.'.$extension);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->errors[] = sprintf(Tools::displayError('File %s have not good extension, only .jpg or .png'), $obj->id.'.'.$extension);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function processForceDeleteImage()
|
||||
{
|
||||
$link = $this->loadObject(true);
|
||||
|
||||
if (Validate::isLoadedObject($link)) {
|
||||
$link->deleteImage(true);
|
||||
}
|
||||
}
|
||||
|
||||
protected function postImage($id)
|
||||
{
|
||||
$ret = parent::postImage($id);
|
||||
$this->refreshPreview();
|
||||
|
||||
if (isset($_FILES) && count($_FILES) && $_FILES['image']['name'] != NULL && !empty($this->object->id) ) {
|
||||
return TRUE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
public function refreshPreview()
|
||||
{
|
||||
$current_preview = _PS_TMP_IMG_DIR_.'advslider_mini_'.$this->object->id_slide.'_'.$this->context->shop->id.'.jpg';
|
||||
|
||||
if (file_exists($current_preview)) {
|
||||
unlink($current_preview);
|
||||
}
|
||||
}
|
||||
|
||||
public function ajaxProcessUpdatePositions()
|
||||
{
|
||||
$way = (int)(Tools::getValue('way'));
|
||||
$id = (int)(Tools::getValue('id'));
|
||||
$positions = Tools::getValue('slide');
|
||||
$obj = 'advslider';
|
||||
|
||||
if (is_array($positions)) {
|
||||
foreach ($positions as $position => $value) {
|
||||
$pos = explode('_', $value);
|
||||
|
||||
if (isset($pos[2]) && (int)$pos[2] === $id) {
|
||||
$menu_obj = new AdvSlide((int)$pos[2]);
|
||||
|
||||
if (Validate::isLoadedObject($menu_obj)) {
|
||||
if (isset($position) && $menu_obj->updatePosition($way, $position)) {
|
||||
echo 'ok position '.(int)$position.' for '.$obj.' '.(int)$pos[2]."\r\n";
|
||||
}
|
||||
else {
|
||||
echo '{"hasError" : true, "errors" : "Can not update '.$obj.' '.(int)$id.' to position '.(int)$position.' "}';
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo '{"hasError" : true, "errors" : "This '.$obj.' ('.(int)$id.') cannot be loaded"}';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
126
modules/advslider/controllers/hook/getContent.php
Normal file
126
modules/advslider/controllers/hook/getContent.php
Normal file
@ -0,0 +1,126 @@
|
||||
<?php
|
||||
class AdvSliderGetContentController
|
||||
{
|
||||
public function __construct($module, $file, $path)
|
||||
{
|
||||
$this->file = $file;
|
||||
$this->module = $module;
|
||||
$this->context = Context::getContext();
|
||||
$this->_path = $path;
|
||||
}
|
||||
|
||||
public function processConfiguration()
|
||||
{
|
||||
if (Tools::isSubmit('submitAdvsliderconfig')) {
|
||||
$enable_date = Tools::getValue('enable_date');
|
||||
$enable_groups = Tools::getValue('enable_groups');
|
||||
$default_group = Tools::getValue('default_group');
|
||||
Configuration::updateValue('ADVSLIDER_RESTRICT_DATE', $enable_date);
|
||||
Configuration::updateValue('ADVSLIDER_RESTRICT_GROUP', $enable_groups);
|
||||
Configuration::updateValue('ADVSLIDER_DEFAULT_GROUP', $default_group);
|
||||
$this->context->smarty->assign('confirmation', 'ok');
|
||||
}
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
$groups = Group::getGroups($this->context->language->id);
|
||||
$optionGroups = array();
|
||||
if (count($groups) > 0) {
|
||||
foreach ($groups as $group) {
|
||||
if (in_array($group['id_group'], array(1,2))) {
|
||||
continue;
|
||||
}
|
||||
$optionGroups[] = array(
|
||||
'id_group' => $group['id_group'],
|
||||
'name' => $group['name'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$fields_form = array(
|
||||
'form' => array(
|
||||
'legend' => array(
|
||||
'title' => $this->module->l('AdvSlider configuration'),
|
||||
'icon' => 'icon-envelope'
|
||||
),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'switch',
|
||||
'label' => $this->module->l('Enable Date restriction:'),
|
||||
'name' => 'enable_date',
|
||||
'desc' => $this->module->l('Enable restriction by date.'),
|
||||
'values' => array(
|
||||
array('id' => 'enable_date_1', 'value' => 1, 'label' => $this->module->l('Enabled')),
|
||||
array('id' => 'enable_date_0', 'value' => 0, 'label' => $this->module->l('Disabled'))
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'switch',
|
||||
'label' => $this->module->l('Enable Groups Restriction:'),
|
||||
'name' => 'enable_groups',
|
||||
'desc' => $this->module->l('Enable restriction by user groups.'),
|
||||
'values' => array(
|
||||
array('id' => 'enable_groups_1', 'value' => 1, 'label' => $this->module->l('Enabled')),
|
||||
array('id' => 'enable_groups_0', 'value' => 0, 'label' => $this->module->l('Disabled'))
|
||||
),
|
||||
|
||||
),
|
||||
array(
|
||||
'type' => 'checkbox',
|
||||
'label' => $this->module->l('User group to display for restriction'),
|
||||
'name' => 'groups',
|
||||
'values' => array(
|
||||
'query' => $optionGroups,
|
||||
'id' => 'id_group',
|
||||
'name' => 'name',
|
||||
),
|
||||
'expand' => array(
|
||||
'default' => 'show',
|
||||
'show' => array('text' => $this->module->l('show'), 'icon' => 'plus-sign-alt'),
|
||||
'hide' => array('text' => $this->module->l('hide'), 'icon' => 'minus-sign-alt')
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'select',
|
||||
'label' => $this->module->l('Default group to display:'),
|
||||
'name' => 'default_group',
|
||||
'desc' => $this->module->l('Set a Default group to display slider with unauthenticated user.'),
|
||||
'options' => array(
|
||||
'query' => $optionGroups,
|
||||
'id' => 'id_group',
|
||||
'name' => 'name',
|
||||
),
|
||||
),
|
||||
),
|
||||
'submit' => array('title' => $this->module->l('Save')),
|
||||
)
|
||||
);
|
||||
|
||||
$helper = new HelperForm();
|
||||
$helper->table = 'advslider';
|
||||
$helper->default_form_language = (int)Configuration::get('PS_LANG_DEFAULT');
|
||||
$helper->allow_employee_form_lang = (int)Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG');
|
||||
$helper->submit_action = 'submitAdvsliderconfig';
|
||||
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->module->name.'&tab_module='.$this->module->tab.'&module_name='.$this->module->name;
|
||||
$helper->token = Tools::getAdminTokenLite('AdminModules');
|
||||
$helper->tpl_vars = array(
|
||||
'fields_value' => array(
|
||||
'enable_date' => Tools::getValue('enable_date', Configuration::get('ADVSLIDER_RESTRICT_DATE')),
|
||||
'enable_groups' => Tools::getValue('enable_groups', Configuration::get('ADVSLIDER_RESTRICT_GROUP')),
|
||||
'default_group' => Tools::getValue('default_group', Configuration::get('ADVSLIDER_DEFAULT_GROUP')),
|
||||
),
|
||||
'languages' => $this->context->controller->getLanguages()
|
||||
);
|
||||
|
||||
return $helper->generateForm(array($fields_form));
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
$this->processConfiguration();
|
||||
$html_confirmation_message = $this->module->display($this->file, 'getContent.tpl');
|
||||
$html_form = $this->renderForm();
|
||||
return $html_confirmation_message.$html_form;
|
||||
}
|
||||
}
|
35
modules/advslider/index.php
Normal file
35
modules/advslider/index.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2014 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2014 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
5
modules/advslider/js/flexslider.js
Normal file
5
modules/advslider/js/flexslider.js
Normal file
File diff suppressed because one or more lines are too long
BIN
modules/advslider/logo.gif
Normal file
BIN
modules/advslider/logo.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
BIN
modules/advslider/logo.png
Normal file
BIN
modules/advslider/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.1 KiB |
@ -0,0 +1,69 @@
|
||||
{if strpos($name, 'multilang') === false}
|
||||
{include file='helpers/uploader/simple.tpl'}
|
||||
{else}
|
||||
{assign var=languages value=Language::getLanguages(false)}
|
||||
{if !isset($defaultFormLanguage)}
|
||||
{assign var=defaultFormLanguage value=$languages[0].id_lang}
|
||||
{/if}
|
||||
<div class="row">
|
||||
{foreach from=$languages item=language}
|
||||
{if $languages|count > 1}
|
||||
<div class="translatable-field lang-{$language.id_lang}" {if $language.id_lang != $defaultFormLanguage}style="display:none"{/if}>
|
||||
{/if}
|
||||
<div class="col-lg-6">
|
||||
|
||||
{foreach $files as $file}
|
||||
{if isset($file.image) && $file.type == 'image'}
|
||||
<div>
|
||||
{if !empty($file.image[$language['id_lang']])}
|
||||
{if Validate::isUrl($file.image[$language['id_lang']])}<img src="{$file.image[$language['id_lang']]}" class="img-thumbnail" />{else}{$file.image[$language['id_lang']]}{/if}
|
||||
{if isset($file.delete_url[$language['id_lang']])}<a href="{$file.delete_url[$language['id_lang']]}">{l s='Supprimer'}</a>{/if}
|
||||
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
|
||||
<input id="{$name}_{$language.id_lang}" type="file" name="{$name}_{$language.id_lang}" class="hide" />
|
||||
<div class="dummyfile input-group">
|
||||
<span class="input-group-addon"><i class="icon-file"></i></span>
|
||||
<input id="{$name}_{$language.id_lang}-name" type="text" class="disabled" name="filename" readonly />
|
||||
<span class="input-group-btn">
|
||||
<button id="{$name}_{$language.id_lang}-selectbutton" type="button" name="submitAddAttachments" class="btn btn-default">
|
||||
<i class="icon-folder-open"></i> {l s='Choose a file'}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{if $languages|count > 1}
|
||||
<div class="col-lg-2">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" tabindex="-1" data-toggle="dropdown">
|
||||
{$language.iso_code}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{foreach from=$languages item=lang}
|
||||
<li><a href="javascript:hideOtherLanguage({$lang.id_lang});" tabindex="-1">{$lang.name}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
{/if}
|
||||
{if $languages|count > 1}
|
||||
</div>
|
||||
{/if}
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('#{$name}_{$language.id_lang}-selectbutton').click(function(e){
|
||||
$('#{$name}_{$language.id_lang}').trigger('click');
|
||||
});
|
||||
$('#{$name}_{$language.id_lang}').change(function(e){
|
||||
var val = $(this).val();
|
||||
var file = val.split(/[\\/]/);
|
||||
$('#{$name}_{$language.id_lang}-name').val(file[file.length-1]);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/foreach}
|
||||
</div>
|
||||
|
||||
{/if}
|
1
modules/advslider/views/templates/hook/advslider.tpl
Normal file
1
modules/advslider/views/templates/hook/advslider.tpl
Normal file
@ -0,0 +1 @@
|
||||
{$slides|p}
|
3
modules/advslider/views/templates/hook/getContent.tpl
Normal file
3
modules/advslider/views/templates/hook/getContent.tpl
Normal file
@ -0,0 +1,3 @@
|
||||
{if isset($confirmation)}
|
||||
<div class="alert alert-success">{l s='Settings updated' mod='advslider'}</div>
|
||||
{/if}
|
@ -38,13 +38,15 @@
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function postProcess(){
|
||||
public function postProcess()
|
||||
{
|
||||
parent::postProcess();
|
||||
if (Tools::isSubmit('submitNewsletterExportPart')
|
||||
|| Tools::isSubmit('submitNewsletterExportPartV2')
|
||||
|| Tools::isSubmit('submitNewsletterExportPartV3')
|
||||
|| Tools::isSubmit('submitNewsletterExportPartV4')
|
||||
|| Tools::isSubmit('submitNewsletterExportPartV5')
|
||||
|| Tools::isSubmit('submitNewsletterExportPartV6')
|
||||
) {
|
||||
$_GET['id_group'] = 3;
|
||||
$this->trackingSuffix = 'PART';
|
||||
@ -65,24 +67,38 @@
|
||||
$this->trackingSuffix = 'PART';
|
||||
break;
|
||||
}
|
||||
// Disable
|
||||
if (Tools::isSubmit('submitNewsletterExportPartV2')) {
|
||||
$this->version = 2;
|
||||
}
|
||||
// Enable : Export Part - 1 vente en cours /ligne
|
||||
if (Tools::isSubmit('submitNewsletterExportPartV3')) {
|
||||
$this->version = 3;
|
||||
$this->enableV4header = true;
|
||||
}
|
||||
// Disable
|
||||
if (Tools::isSubmit('submitNewsletterExportPartV4')) {
|
||||
$this->version = 3;
|
||||
$this->subVersion = true;
|
||||
}
|
||||
// Enable : Export Part - 2 ventes en cours /ligne
|
||||
if (Tools::isSubmit('submitNewsletterExportPartV5')) {
|
||||
$this->version = 5;
|
||||
$this->subVersion = true;
|
||||
}
|
||||
// Enable : Export Pro - 2 ventes en cours /ligne
|
||||
if (Tools::isSubmit('submitNewsletterExportPartV6')) {
|
||||
$this->version = 5;
|
||||
$_GET['id_group'] = 4;
|
||||
$this->subVersion = true;
|
||||
$this->trackingSuffix = 'PRO';
|
||||
}
|
||||
$this->exportNewsletter();
|
||||
}
|
||||
elseif (Tools::isSubmit('submitNewsletterExportPro')){
|
||||
// Enable : Export Pro - 1 vente en cours /ligne
|
||||
elseif (Tools::isSubmit('submitNewsletterExportPro')) {
|
||||
$this->version = 3;
|
||||
$this->enableV4header = true;
|
||||
$_GET['id_group'] = 4;
|
||||
// reactiver la generation du tracking dans le cron si on veut utiliser le tracking PRO
|
||||
$this->trackingSuffix = 'PRO';
|
||||
@ -100,8 +116,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
public function renderForm(){
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
$options = array(
|
||||
array(
|
||||
'id_option' => 0,
|
||||
@ -308,7 +324,7 @@
|
||||
)
|
||||
);
|
||||
|
||||
$formExportPart = array(
|
||||
/*$formExportPart = array(
|
||||
'form' => array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Export PART - 2 ventes par ligne'),
|
||||
@ -320,9 +336,9 @@
|
||||
'title' => $this->l('Export PART'),
|
||||
),
|
||||
)
|
||||
);
|
||||
);*/
|
||||
|
||||
$formExportPartV2 = array(
|
||||
/*$formExportPartV2 = array(
|
||||
'form' => array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Export PART Version 2 - une vente/ligne'),
|
||||
@ -334,23 +350,23 @@
|
||||
'title' => $this->l('Export PART V2'),
|
||||
),
|
||||
)
|
||||
);
|
||||
);*/
|
||||
|
||||
$formExportPartV3 = array(
|
||||
'form' => array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Export PART Version 3 - une vente/ligne - Newsletter light'),
|
||||
'title' => $this->l('Export PART - 1 vente en cours /ligne'),
|
||||
),
|
||||
'input' => array(
|
||||
),
|
||||
'submit' => array(
|
||||
'name' => 'submitNewsletterExportPartV3',
|
||||
'title' => $this->l('Export PART LIGHT'),
|
||||
'title' => $this->l('Export'),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$formExportPartV4 = array(
|
||||
/*$formExportPartV4 = array(
|
||||
'form' => array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Export PART VERSION 4 - 2 VENTES/LIGNE - Newsletter LIGHT')
|
||||
@ -358,48 +374,63 @@
|
||||
'input' => array(
|
||||
),
|
||||
'submit' => array(
|
||||
'title' => $this->l('Export PART V4'),
|
||||
'title' => $this->l('Export'),
|
||||
'name' => 'submitNewsletterExportPartV4'
|
||||
),
|
||||
),
|
||||
);*/
|
||||
|
||||
$formExportPro = array(
|
||||
'form' => array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Export PRO - 1 vente en cours /ligne'),
|
||||
),
|
||||
'input' => array(
|
||||
),
|
||||
'submit' => array(
|
||||
'name' => 'submitNewsletterExportPro',
|
||||
'title' => $this->l('Export'),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
$formExportPartV5 = array(
|
||||
'form' => array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Export PART VERSION 5 - VENTES/LIGNE - Newsletter LIGHT')
|
||||
'title' => $this->l('Export PART - 2 ventes en cours /ligne')
|
||||
),
|
||||
'input' => array(
|
||||
),
|
||||
'submit' => array(
|
||||
'title' => $this->l('Export PART V5'),
|
||||
'title' => $this->l('Export'),
|
||||
'name' => 'submitNewsletterExportPartV5'
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$formExportPro = array(
|
||||
$formExportPartV6 = array(
|
||||
'form' => array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Export PRO'),
|
||||
'title' => $this->l('Export PRO - 2 ventes en cours /ligne')
|
||||
),
|
||||
'input' => array(
|
||||
),
|
||||
'submit' => array(
|
||||
'name' => 'submitNewsletterExportPartV4',
|
||||
'title' => $this->l('Export PRO'),
|
||||
'title' => $this->l('Export'),
|
||||
'name' => 'submitNewsletterExportPartV6'
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
$this->fields_form = array(
|
||||
$this->fields_form = array(
|
||||
$formSettings,
|
||||
$formExportPart,
|
||||
$formExportPartV2,
|
||||
//$formExportPart,
|
||||
//$formExportPartV2,
|
||||
$formExportPartV3,
|
||||
$formExportPartV4,
|
||||
//$formExportPartV4,
|
||||
$formExportPartV5,
|
||||
$formExportPro
|
||||
$formExportPro,
|
||||
$formExportPartV6,
|
||||
);
|
||||
|
||||
$this->display = 'add';
|
||||
@ -777,8 +808,8 @@
|
||||
return $id_privatesalesList;
|
||||
}
|
||||
|
||||
public function exportNewsletter(){
|
||||
|
||||
public function exportNewsletter()
|
||||
{
|
||||
$this->_params = array(
|
||||
'date' => Tools::getValue('ANT_EXPORT_NEWSLETTER_DATE', Configuration::get('ANT_EXPORT_NEWSLETTER_DATE')),
|
||||
'blog' => Tools::getValue('ANT_EXPORT_NEWSLETTER_BLOG', Configuration::get('ANT_EXPORT_NEWSLETTER_BLOG')),
|
||||
@ -801,13 +832,11 @@
|
||||
}*/
|
||||
|
||||
$date = $this->_params['date'];
|
||||
|
||||
$newPrivateSales = $this->_getPrivateSales($this->_getNewPrivateSalesQuery(), 0, NULL, self::TYPE_STARTING);
|
||||
$id_privatesalesExcludeList = $this->_getIdPrivateSalesList($newPrivateSales);
|
||||
$nearEndPrivateSales = $this->_getPrivateSales($this->_getNearEndPrivateSalesQuery(), 0, $id_privatesalesExcludeList, self::TYPE_CURRENT);
|
||||
$id_privatesalesExcludeList = array_merge($id_privatesalesExcludeList, $this->_getIdPrivateSalesList($nearEndPrivateSales));
|
||||
$currentPrivateSales = $this->_getPrivateSales($this->_getCurrentPrivateSalesQuery(), 0, $id_privatesalesExcludeList, self::TYPE_ENDING);
|
||||
|
||||
foreach ($newPrivateSales as $key => &$sale) {
|
||||
$sale['link'] = urlencode($sale['link'].'?tr=NL'.date('dmy', strtotime($this->_params['date'])).'_'.$this->trackingSuffix);
|
||||
}
|
||||
@ -960,7 +989,8 @@
|
||||
die();
|
||||
}
|
||||
|
||||
public function renderView(){
|
||||
public function renderView()
|
||||
{
|
||||
return $this->exportNewsletter();
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
<?php
|
||||
include_once(_PS_MODULE_DIR_.'antadismarketing/antadismarketing.php');
|
||||
|
||||
ini_set('memory_limit', '2048M');
|
||||
|
||||
class AdminAntMarketingStatsController extends ModuleAdminController {
|
||||
|
||||
public $tracking_category = null;
|
||||
|
@ -521,7 +521,7 @@ class Mailjet_Sync extends Module
|
||||
"fai" => $email,
|
||||
"group" => $isPro ? 'Pro' : 'Particulier',
|
||||
"date_inscription" => date('Y-m-d\TH:i:s\Z',strtotime($customer->date_add)),
|
||||
"ref_inscription" => (int)strtotime($customer->date_add),
|
||||
"ref_inscr" => (int)strtotime($customer->date_add),
|
||||
"id" => $customer->id,
|
||||
)
|
||||
)
|
||||
@ -555,6 +555,7 @@ class Mailjet_Sync extends Module
|
||||
)
|
||||
);
|
||||
$mj = $this->getClient();
|
||||
|
||||
if ($mj->addDetailedContactToList($contacts, $lists)) {
|
||||
return true;
|
||||
} else {
|
||||
|
@ -74,8 +74,8 @@
|
||||
};
|
||||
// Handle input click of the other input to hide the previous relay point list displayed
|
||||
$('input[name=id_carrier], input.delivery_option_radio').click(function(e){
|
||||
// Only make action on carrier ID 236
|
||||
if ($(this).data('key') == '236,') {
|
||||
// Only make action on carrier ID 236 but 380 in production - conflict with soflexibilite
|
||||
if ($(this).data('key') == '380,' || $(this).data('key') == '392,') {
|
||||
if ( e.isPropagationStopped() ) {
|
||||
return false;
|
||||
}
|
||||
|
@ -50,10 +50,24 @@ class privatesaleshomeModuleFrontController extends ModuleFrontController {
|
||||
$this->setTemplate('privatesales-home.tpl');
|
||||
|
||||
// 12613 - Optimisation
|
||||
$sale_cache = new SaleCache($this->context, "home", 7200, $news); // 2 Hours
|
||||
if ($sale_cache->isCached($this->template)) {
|
||||
$this->setCacheHtml($sale_cache->getCache());
|
||||
return;
|
||||
if(Configuration::get('PS_SMARTY_CACHE') == 1) {
|
||||
$lifetime = 7200;
|
||||
switch (Configuration::get('PS_SMARTY_FORCE_COMPILE')) {
|
||||
case 0:
|
||||
case 1:
|
||||
$lifetime = 7200;
|
||||
break;
|
||||
case 2:
|
||||
$lifetime = 0;
|
||||
break;
|
||||
}
|
||||
if ($lifetime > 0) {
|
||||
$sale_cache = new SaleCache($this->context, "home", $lifetime, $news);
|
||||
if ($sale_cache->isCached($this->template)) {
|
||||
$this->setCacheHtml($sale_cache->getCache());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 12613 - End optimisation
|
||||
|
||||
|
@ -32,7 +32,13 @@ class SaleCache
|
||||
$this->cache_id = md5("private_sales_".$cache_prefix."_".$d->format('Ymd'));
|
||||
|
||||
$this->max_filemtime = $d->getTimestamp() - $lifetime;
|
||||
$this->path_cache_file = __DIR__.'/../cache/'.$this->cache_id;
|
||||
|
||||
$path_cache = _PS_CACHE_DIR_.'smarty/cache/privatesales';
|
||||
if (!file_exists($path_cache)) {
|
||||
mkdir($path_cache, 0755);
|
||||
}
|
||||
$this->path_cache_file = $path_cache.'/'.$this->cache_id;
|
||||
|
||||
$this->smarty = $context->smarty;
|
||||
}
|
||||
|
||||
@ -64,7 +70,7 @@ class SaleCache
|
||||
|
||||
static function clearAll()
|
||||
{
|
||||
foreach(glob(__DIR__.'/../cache/*') as $path_file) {
|
||||
foreach(glob(_PS_CACHE_DIR_.'smarty/cache/privatesales/*') as $path_file) {
|
||||
if (preg_match('/index\.php$/', $path_file)===1) {
|
||||
continue;
|
||||
}
|
||||
|
@ -346,7 +346,8 @@ class SaleCore extends ObjectModel{
|
||||
*
|
||||
*/
|
||||
|
||||
public static function getSales($type = "all", $date_limit = 0, $active = TRUE, $archived = FALSE, $group = TRUE, $order_by = 'position', $order = 'ASC',$id_category = FALSE, $flashsale = FALSE, $newssale = NULL, $getCollection = FALSE){
|
||||
public static function getSales($type = "all", $date_limit = 0, $active = TRUE, $archived = FALSE, $group = TRUE, $order_by = 'position', $order = 'ASC',$id_category = FALSE, $flashsale = FALSE, $newssale = NULL, $getCollection = FALSE)
|
||||
{
|
||||
$collection = new Collection('SaleCore', Context::getContext()->language->id);
|
||||
|
||||
$date_now = date('Y-m-d H:i:s');
|
||||
@ -390,7 +391,18 @@ class SaleCore extends ObjectModel{
|
||||
$collection->where('news', '=', 0);
|
||||
}
|
||||
|
||||
if($group){
|
||||
if (isset($_GET['id_group'])) {
|
||||
$collection->Sqlwhere('EXISTS (
|
||||
SELECT g.id_privatesales
|
||||
FROM `' . _DB_PREFIX_ . 'privatesales_group` g
|
||||
WHERE
|
||||
a0.`id_privatesales` = g.`id_privatesales`
|
||||
AND
|
||||
g.id_group = '.(int)$_GET['id_group'].')
|
||||
');
|
||||
}
|
||||
|
||||
if($group) {
|
||||
$collection->Sqlwhere('EXISTS (
|
||||
SELECT g.id_privatesales
|
||||
FROM `' . _DB_PREFIX_ . 'privatesales_group` g
|
||||
|
@ -35,19 +35,17 @@ class FrontController extends FrontControllerCore
|
||||
parent::setMedia();
|
||||
$this->addCSS(_THEME_CSS_DIR_.'global2.css', 'all');
|
||||
}
|
||||
/*public function init(){
|
||||
if (class_exists('Mobile_Detect')) {
|
||||
$mobile = new Mobile_Detect();
|
||||
if($mobile->isMobile() && !$mobile->isTablet() && $_SERVER['REMOTE_ADDR'] != "88.120.248.124" && $_SERVER['REMOTE_ADDR'] != "88.120.249.228"){
|
||||
Tools::redirect('http://m.privilegedemarque.com');
|
||||
}
|
||||
}
|
||||
|
||||
parent::init();
|
||||
|
||||
}*/
|
||||
|
||||
public function init(){
|
||||
public function init()
|
||||
{
|
||||
// Detection provenance campagne email depuis mobile et non connecté
|
||||
if ($this->context->getMobileDevice() && !Customer::isLogged()){
|
||||
$popup = Tools::getValue('popup');
|
||||
$source = Tools::getValue('source');
|
||||
if ($popup == 1 && !empty($source)) {
|
||||
Tools::redirect($this->context->link->getPageLink('authentication', true).'?create_account=1');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->context->cookie->account_created))
|
||||
$this->context->smarty->assign('customer', $this->context->customer);
|
||||
@ -88,8 +86,7 @@ class FrontController extends FrontControllerCore
|
||||
);
|
||||
$this->context->smarty->assign('popup_free_shipping', false);
|
||||
$this->context->smarty->assign('homebg_active', Configuration::get('PRIVATESALES_HOME_BG'));
|
||||
if(in_array($page_name, $array_page_name_popup_shipping)
|
||||
&& false) //DESACTIVE
|
||||
if(in_array($page_name, $array_page_name_popup_shipping) && false) //DESACTIVE
|
||||
{
|
||||
$cookie_name_popup_shipping = 'p-fsh';
|
||||
if(!isset($_COOKIE[$cookie_name_popup_shipping])
|
||||
|
@ -2481,7 +2481,7 @@ label{
|
||||
.container-menu ul.sf-menu.menu-content > li:nth-child(2) > a {
|
||||
color: #ef5149;
|
||||
}
|
||||
.container-menu ul.sf-menu.menu-content > li:nth-child(2) > a:before {
|
||||
/*.container-menu ul.sf-menu.menu-content > li:nth-child(2) > a:before {
|
||||
bottom: 8px;
|
||||
content: "en vrac";
|
||||
font-family: "Journal";
|
||||
@ -2490,7 +2490,7 @@ label{
|
||||
position: absolute;
|
||||
right: 8px;
|
||||
text-transform: none;
|
||||
}
|
||||
}*/
|
||||
.container-menu ul.sf-menu.menu-content > li:first-child a{
|
||||
font-weight: bold;
|
||||
padding-bottom: 18px;
|
||||
|
@ -302,171 +302,140 @@
|
||||
|
||||
<div class="popup_overlay" style="display: none;"></div>
|
||||
<script type="text/javascript">
|
||||
var nom = "{l s='Votre nom est manquant'}";
|
||||
var prenom = "{l s='Votre prénom est manquant'}";
|
||||
var mdp = "{l s='Votre mot de passe est manquant'}";
|
||||
var mdp2 = "{l s='Votre mot de passe est trop court'}";
|
||||
var mail = "{l s='Votre adresse email est manquante'}";
|
||||
var newsletter = "{l s='Acceptez les conditions générales d\'utilisations'}";
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
{if !isset($cookie->isAccountExists) || $cookie->isAccountExists == "0"}
|
||||
//var timer = setTimeout( showPopupWelcome, 1000);
|
||||
{/if}
|
||||
{literal}
|
||||
var open = false;
|
||||
function showPopupWelcome(){
|
||||
if(!open){
|
||||
$('.popup_overlay').fadeIn(100);
|
||||
$('.popup_welcome').fadeIn(250);
|
||||
open = true;
|
||||
}
|
||||
}
|
||||
$(document).ready(function() {
|
||||
if(mobilecheck()==false){
|
||||
$(function(){
|
||||
$('a.loggin_button').on('touchstart', function(e){
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
alert("Clicked");
|
||||
});
|
||||
});
|
||||
|
||||
$("div.product-container").attr('onclick', '');
|
||||
$("div.sale_desc").attr('onclick', '');
|
||||
$("div.sale_container").attr('onclick', '');
|
||||
$(".sale, .sale a.button-grey, div.product-container, div.product-container a, div.product-container a.button-grey, .breadcrumb a, a.back_, a.back_sale,#category #header_logo a,#category #block_top_menu ul li:first-child,#product #header_logo a,#product #block_top_menu ul li:first-child, a.loggin_button, .slide-home a").on('click touchstart', function(e) {
|
||||
e.stopPropagation();
|
||||
var href = '/';
|
||||
if(typeof $(this).attr('href') != 'undefined') {
|
||||
href = $(this).attr('href');
|
||||
}
|
||||
else {
|
||||
if($(this).find('a.button-grey').size() > 0) {
|
||||
href = $(this).find('a.button-grey').attr('href');
|
||||
}
|
||||
}
|
||||
|
||||
$('.privatesales_popup_connection').find('input[name=back]').val(href);
|
||||
$('.popup_overlay').fadeIn(100);
|
||||
$('.privatesales_popup_connection').fadeIn(250);
|
||||
return false;
|
||||
});
|
||||
|
||||
/*$('li.modalbox').unbind('click').click(function(){
|
||||
$('.popup_overlay').fadeIn(100);
|
||||
$('.privatesales_popup_connection').fadeIn(250);
|
||||
});*/
|
||||
{/literal}{if !isset($smarty.get.popup) && !isset($smarty.get.source)}{literal}
|
||||
$('.popup_overlay').on('click touchstart', function(){
|
||||
$(this).fadeOut(100);
|
||||
$('.privatesales_popup_connection').fadeOut(100);
|
||||
$('.popup_welcome').fadeOut(100);
|
||||
open = false;
|
||||
});
|
||||
$('.close_popup').click(function(){
|
||||
$('.popup_overlay').fadeOut(100);
|
||||
$('.popup_welcome').fadeOut(100);
|
||||
open = false;
|
||||
return false;
|
||||
});
|
||||
{/literal}{/if}{literal}
|
||||
|
||||
{/literal}{if isset($smarty.get.popup)}{literal}
|
||||
$(".loggin_button").trigger("click");
|
||||
$(".to_step_create").trigger("click");
|
||||
{/literal}{if $smarty.get.source}{literal}
|
||||
$("#referralprogram").val("{/literal}{$smarty.get.source|replace:' ':'+'}{literal}");
|
||||
var href_link_conditions = $("#link_conditions").attr('href');
|
||||
$("#link_conditions").attr('href', href_link_conditions + '?content_only=1');
|
||||
{/literal}{/if}{literal}
|
||||
|
||||
{/literal}{/if}{literal}
|
||||
|
||||
var nom = "{l s='Votre nom est manquant'}";
|
||||
var prenom = "{l s='Votre prénom est manquant'}";
|
||||
var mdp = "{l s='Votre mot de passe est manquant'}";
|
||||
var mdp2 = "{l s='Votre mot de passe est trop court'}";
|
||||
var mail = "{l s='Votre adresse email est manquante'}";
|
||||
var newsletter = "{l s='Acceptez les conditions générales d\'utilisations'}";
|
||||
{literal}
|
||||
var open = false;
|
||||
function showPopupWelcome(){
|
||||
if(!open){
|
||||
$('.popup_overlay').fadeIn(100);
|
||||
$('.popup_welcome').fadeIn(250);
|
||||
open = true;
|
||||
}
|
||||
}
|
||||
$(document).ready(function() {
|
||||
if(mobilecheck()==false){
|
||||
$('a.loggin_button').on('touchstart', function(e){
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
});
|
||||
$("div.product-container").attr('onclick', '');
|
||||
$("div.sale_desc").attr('onclick', '');
|
||||
$("div.sale_container").attr('onclick', '');
|
||||
$(".sale, .sale a.button-grey, div.product-container, div.product-container a, div.product-container a.button-grey, .breadcrumb a, a.back_, a.back_sale,#category #header_logo a,#category #block_top_menu ul li:first-child,#product #header_logo a,#product #block_top_menu ul li:first-child, a.loggin_button, .slide-home a").on('click touchstart', function(e) {
|
||||
e.stopPropagation();
|
||||
var href = '/';
|
||||
if(typeof $(this).attr('href') != 'undefined') {
|
||||
href = $(this).attr('href');
|
||||
}
|
||||
else {
|
||||
|
||||
$(".sale a.button-grey, div.product-container a, div.product-container a.button-grey, .breadcrumb a, a.back_, a.back_sale,#category #header_logo a,#category #block_top_menu ul li:first-child,#product #header_logo a,#product #block_top_menu ul li:first-child, a.loggin_button, .slide-home a").on('click touchstart', function(e) {
|
||||
e.stopPropagation();
|
||||
var href = '/';
|
||||
if(typeof $(this).attr('href') != 'undefined') {
|
||||
href = $(this).attr('href');
|
||||
}
|
||||
else {
|
||||
if($(this).find('a.button-grey').size() > 0) {
|
||||
href = $(this).find('a.button-grey').attr('href');
|
||||
}
|
||||
}
|
||||
$(location).attr('href',"{/literal}{$base_dir}ventes-privees{literal}");
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
$(".nextStep").bind( "click", function() {
|
||||
var error = false;
|
||||
if(!$('#customer_firstname').val()){
|
||||
$('.error.firstname').html(prenom);
|
||||
$('.error.firstname').show();
|
||||
error = true;
|
||||
}
|
||||
if(!$('#customer_lastname').val()){
|
||||
$('.error.lastname').html(nom);
|
||||
$('.error.lastname').show();
|
||||
error = true;
|
||||
}
|
||||
if(!$('#email').val()){
|
||||
$('.error.email').html(mail);
|
||||
$('.error.email').show();
|
||||
error = true;
|
||||
}
|
||||
if(!$('#passwd').val()){
|
||||
$('.error.password').html(mdp);
|
||||
$('.error.password').show();
|
||||
error = true;
|
||||
}else{
|
||||
var pass = $('#passwd').val();
|
||||
if(pass.length < 6){
|
||||
$('.error.password').html(mdp2);
|
||||
$('.error.password').show();
|
||||
error = true;
|
||||
if($(this).find('a.button-grey').size() > 0) {
|
||||
href = $(this).find('a.button-grey').attr('href');
|
||||
}
|
||||
}
|
||||
if(!error){
|
||||
$('.create_account .error').hide();
|
||||
$(".step_1").hide();
|
||||
$(".step_login").hide();
|
||||
$(".step_2").show();
|
||||
}
|
||||
$('.privatesales_popup_connection').find('input[name=back]').val(href);
|
||||
$('.popup_overlay').fadeIn(100);
|
||||
$('.privatesales_popup_connection').fadeIn(250);
|
||||
return false;
|
||||
});
|
||||
{/literal}{if !isset($smarty.get.popup) && !isset($smarty.get.source)}{literal}
|
||||
$('.popup_overlay').on('click touchstart', function(){
|
||||
$(this).fadeOut(100);
|
||||
$('.privatesales_popup_connection').fadeOut(100);
|
||||
$('.popup_welcome').fadeOut(100);
|
||||
open = false;
|
||||
});
|
||||
$('.close_popup').click(function(){
|
||||
$('.popup_overlay').fadeOut(100);
|
||||
$('.popup_welcome').fadeOut(100);
|
||||
open = false;
|
||||
return false;
|
||||
});
|
||||
{/literal}{/if}{literal}
|
||||
|
||||
$("#submitAccount2").bind( "click", function() {
|
||||
var error = false;
|
||||
if(!$('#newsletter').is(':checked')){
|
||||
$('.error.newsletter').html(newsletter);
|
||||
$('.error.newsletter').show();
|
||||
error = true;
|
||||
}
|
||||
if(!error){
|
||||
$("#submitAccount").trigger("click");
|
||||
}
|
||||
{/literal}{if isset($smarty.get.popup)}{literal}
|
||||
$(".loggin_button").trigger("click");
|
||||
$(".to_step_create").trigger("click");
|
||||
{/literal}{if $smarty.get.source}{literal}
|
||||
$("#referralprogram").val("{/literal}{$smarty.get.source|replace:' ':'+'}{literal}");
|
||||
var href_link_conditions = $("#link_conditions").attr('href');
|
||||
$("#link_conditions").attr('href', href_link_conditions + '?content_only=1');
|
||||
{/literal}{/if}{literal}
|
||||
{/literal}{/if}{literal}
|
||||
}
|
||||
else {
|
||||
$(".sale a.button-grey, div.product-container a, div.product-container a.button-grey, .breadcrumb a, a.back_, a.back_sale, #category #header_logo a,#category #block_top_menu ul li:first-child,#product #header_logo a,#product #block_top_menu ul li:first-child, a.loggin_button, .slide-home a").on('click touchstart', function(e) {
|
||||
e.stopPropagation();
|
||||
$(location).attr('href',"{/literal}{$base_dir}ventes-privees?create_account=1{literal}");
|
||||
return false;
|
||||
});
|
||||
}
|
||||
});
|
||||
$(".nextStep").bind( "click", function() {
|
||||
var error = false;
|
||||
if(!$('#customer_firstname').val()){
|
||||
$('.error.firstname').html(prenom);
|
||||
$('.error.firstname').show();
|
||||
error = true;
|
||||
}
|
||||
if(!$('#customer_lastname').val()){
|
||||
$('.error.lastname').html(nom);
|
||||
$('.error.lastname').show();
|
||||
error = true;
|
||||
}
|
||||
if(!$('#email').val()){
|
||||
$('.error.email').html(mail);
|
||||
$('.error.email').show();
|
||||
error = true;
|
||||
}
|
||||
if(!$('#passwd').val()){
|
||||
$('.error.password').html(mdp);
|
||||
$('.error.password').show();
|
||||
error = true;
|
||||
}else{
|
||||
var pass = $('#passwd').val();
|
||||
if(pass.length < 6){
|
||||
$('.error.password').html(mdp2);
|
||||
$('.error.password').show();
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
if(!error){
|
||||
$('.create_account .error').hide();
|
||||
$(".step_1").hide();
|
||||
$(".step_login").hide();
|
||||
$(".step_2").show();
|
||||
}
|
||||
});
|
||||
|
||||
$(".to_step_login").bind( "click", function(e) {
|
||||
e.preventDefault();
|
||||
$(".login_form").show();
|
||||
$(".create_form").hide();
|
||||
});
|
||||
$(".to_step_create").bind( "click", function(e) {
|
||||
e.preventDefault();
|
||||
$(".login_form").hide();
|
||||
$(".create_form").show();
|
||||
});
|
||||
$("#submitAccount2").bind( "click", function() {
|
||||
var error = false;
|
||||
if(!$('#newsletter').is(':checked')){
|
||||
$('.error.newsletter').html(newsletter);
|
||||
$('.error.newsletter').show();
|
||||
error = true;
|
||||
}
|
||||
if(!error){
|
||||
$("#submitAccount").trigger("click");
|
||||
}
|
||||
});
|
||||
|
||||
{/literal}
|
||||
</script>
|
||||
$(".to_step_login").bind( "click", function(e) {
|
||||
e.preventDefault();
|
||||
$(".login_form").show();
|
||||
$(".create_form").hide();
|
||||
});
|
||||
$(".to_step_create").bind( "click", function(e) {
|
||||
e.preventDefault();
|
||||
$(".login_form").hide();
|
||||
$(".create_form").show();
|
||||
});
|
||||
{/literal}
|
||||
</script>
|
||||
{/if}
|
||||
{if (isset($popup_free_shipping) && $popup_free_shipping === true)}
|
||||
<style type='text/css'>
|
||||
@ -637,13 +606,11 @@
|
||||
<script type="text/javascript">
|
||||
window.mobilecheck = function() { var check = false; (function(a,b){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera); return check; }
|
||||
if(mobilecheck()==false){
|
||||
console.log("mobile");
|
||||
(function() {
|
||||
var idz = document.createElement('script'); idz.type = 'text/javascript'; idz.async = true;
|
||||
idz.src = document.location.protocol + "//livechat.iadvize.com/iadvize.js?sid=14713";
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(idz, s);
|
||||
})();
|
||||
|
||||
}
|
||||
</script>
|
||||
{/literal}
|
||||
|
@ -81,38 +81,20 @@
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
{*{literal}
|
||||
<script>(function() {
|
||||
var _fbq = window._fbq || (window._fbq = []);
|
||||
if (!_fbq.loaded) {
|
||||
var fbds = document.createElement('script');
|
||||
fbds.async = true;
|
||||
fbds.src = '//connect.facebook.net/en_US/fbds.js';
|
||||
var s = document.getElementsByTagName('script')[0];
|
||||
s.parentNode.insertBefore(fbds, s);
|
||||
_fbq.loaded = true;
|
||||
}
|
||||
_fbq.push(['addPixelId', '400077940140529']);
|
||||
})();
|
||||
window._fbq = window._fbq || [];
|
||||
window._fbq.push(['track', 'PixelInitialized', {}]);
|
||||
</script>
|
||||
{/literal}*}
|
||||
|
||||
<!-- Facebook Pixel Code -->
|
||||
{literal}
|
||||
<script>
|
||||
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
|
||||
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
|
||||
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
|
||||
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
|
||||
document,'script','//connect.facebook.net/en_US/fbevents.js');
|
||||
fbq('init', '1632642126990378');
|
||||
fbq('track', 'PageView');
|
||||
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
|
||||
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
|
||||
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
|
||||
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
|
||||
document,'script','//connect.facebook.net/en_US/fbevents.js');
|
||||
fbq('init', '1632642126990378');
|
||||
fbq('track', 'PageView');
|
||||
</script>
|
||||
{/literal}
|
||||
<!-- <noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?id=400077940140529&ev=PixelInitialized" /></noscript>
|
||||
-->
|
||||
<noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1632642126990378&ev=PageView&noscript=1"/></noscript>
|
||||
|
||||
<!-- Google Tag Manager : customer data layer -->
|
||||
<script>
|
||||
@ -281,16 +263,17 @@
|
||||
|
||||
{/if}
|
||||
</script>
|
||||
|
||||
<!-- End Google Tag Manager : customer data layer -->
|
||||
|
||||
{literal}
|
||||
<!-- Google Tag Manager -->
|
||||
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||
<script>
|
||||
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
||||
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
||||
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
||||
})(window,document,'script','dataLayer','GTM-M7DXWP');</script>
|
||||
})(window,document,'script','dataLayer','GTM-M7DXWP');
|
||||
</script>
|
||||
<!-- End Google Tag Manager -->
|
||||
{/literal}
|
||||
|
||||
@ -305,7 +288,6 @@
|
||||
{elseif $page_name == 'product'}
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
|
||||
fbq('track', 'ViewContent', {
|
||||
content_name:"{/literal}{$product->name|escape:'html':'UTF-8'}{literal}",
|
||||
content_ids:['{/literal}{$product->id}{literal}'],
|
||||
@ -320,12 +302,9 @@
|
||||
{/if}
|
||||
<body{if isset($page_name)} id="{$page_name|escape:'html':'UTF-8'}"{/if} class="{if isset($page_name)}{$page_name|escape:'html':'UTF-8'}{/if}{if isset($body_classes) && $body_classes|@count} {implode value=$body_classes separator=' '}{/if}{if $hide_left_column} hide-left-column{/if}{if $hide_right_column} hide-right-column{/if}{if isset($content_only) && $content_only} content_only{/if} lang_{$lang_iso} {if !$logged}unlogged{/if}">
|
||||
|
||||
|
||||
<!-- Google Tag Manager (noscript) -->
|
||||
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M7DXWP"
|
||||
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
||||
<!-- End Google Tag Manager (noscript) -->
|
||||
<noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1632642126990378&ev=PageView&noscript=1"/></noscript>
|
||||
<!-- Google Tag Manager (noscript) -->
|
||||
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M7DXWP" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
||||
<!-- End Google Tag Manager (noscript) -->
|
||||
|
||||
{if !isset($content_only) || !$content_only}
|
||||
{if isset($restricted_country_mode) && $restricted_country_mode}
|
||||
@ -336,8 +315,7 @@
|
||||
<div id="fb-root"></div>
|
||||
{literal}
|
||||
<script>
|
||||
|
||||
(function(d, s, id) {
|
||||
(function(d, s, id) {
|
||||
var js, fjs = d.getElementsByTagName(s)[0];
|
||||
if (d.getElementById(id)) return;
|
||||
js = d.createElement(s); js.id = id;
|
||||
@ -361,9 +339,6 @@
|
||||
{/if}
|
||||
<!-- Traccking affilnet END -->
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="page">
|
||||
<div class="header-container">
|
||||
<header id="header">
|
||||
|
@ -751,7 +751,7 @@ $_LANG['product_26f5a22330a8d5d32c87e6a4c7f3de95'] = 'Jusqu\'à';
|
||||
$_LANG['product_28a623fd7e9d81936b562dc5241a16a7'] = 'Ce produit n\'existe pas dans cette déclinaison. Vous pouvez néanmoins en sélectionner une autre.';
|
||||
$_LANG['product_2d0f6b8300be19cf35e89e66f0677f95'] = 'Ajouter au panier';
|
||||
$_LANG['product_3601146c4e948c32b6424d2c0a7f0118'] = 'Prix';
|
||||
$_LANG['product_374689becdae1fa1a84e42f8eac042cd'] = 'Livraison gratuite à partir de 79€ TTC d’achat';
|
||||
$_LANG['product_374689becdae1fa1a84e42f8eac042cd'] = ' Aujourd\'hui livraison gratuite chez vous et en point relais à partir de 49€ TTC';
|
||||
$_LANG['product_3b6d056ac93fc7b1947c3bc2ce720aaf'] = 'Veuillez remplir tous les champs, puis enregistrer votre personnalisation';
|
||||
$_LANG['product_3d0d1f906e27800531e054a3b6787b7c'] = 'Quantité : ';
|
||||
$_LANG['product_441ca5553df52b87e87513c6b88927d3'] = 'd\'éco-participation';
|
||||
|
@ -0,0 +1,28 @@
|
||||
{if $slides|@count > 0}
|
||||
<div class="row slider-ctn">
|
||||
{*desktop*}
|
||||
<div id="slider_home" class="clearfix snotmobile">
|
||||
<div class="clearfix owl">
|
||||
{foreach from=$slides item=slide key=key name=slider}
|
||||
<div class="col-sm-12 slide-home item" style="height:300px;background: url('{$img_ps_dir}slider/{$slide.id_slide}.jpg') no-repeat left top; background-size: 100% auto;">
|
||||
{if isset($slide.url) && $slide.url}
|
||||
<a href="{$slide.url}" style="width:100%;height: 100%;display: block;" {if isset($slide.title) && $slide.title}title="{$slide.title}"{/if}></a>
|
||||
{/if}
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
{*mobile*}
|
||||
<div id="slider_home_mobile" class="clearfix smobile">
|
||||
<div class="clearfix owl">
|
||||
{foreach from=$slides item=slide key=key name=slider}
|
||||
<div class="col-sm-12 slide-home item" style="height:200px;background: url('{$img_ps_dir}slider/{$slide.id_slide}-mobile.jpg') no-repeat center top; background-size: contain;">
|
||||
{if isset($slide.url) && $slide.url}
|
||||
<a {if !$cookie->logged}onclick="window.location.href='{$link->getPageLink('authentication', true)|escape:'html':'UTF-8'}';"{else}href="{$slide.url}"{/if} style="width:100%;height: 100%;display: block;" {if isset($slide.title) && $slide.title}title="{$slide.title}"{/if}></a>
|
||||
{/if}
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
@ -45,14 +45,15 @@
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{if $privatesale->imagelogo}
|
||||
{capture name=img_sale}
|
||||
{$link_img}{$privatesale->id}/logo/{$privatesale->id}_{$cookie->id_lang}.jpg
|
||||
{/capture}
|
||||
<div class="imagelogo">
|
||||
{if $privatesale->imagelogo}
|
||||
<img src="{$smarty.capture.img_sale}"/>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="snotmobile">
|
||||
{if $category->description}
|
||||
{$category->description}
|
||||
|
@ -52,39 +52,14 @@ $(document).ready(function() {
|
||||
<div class="carrier_discount_ctn">
|
||||
<p>{l s='LIVRAISON GRATUITE' mod='privatesales'|escape:'html':'UTF-8'}<span>{l s='à partir de 79€ ttc en Point Relais' mod='privatesales'|escape:'html':'UTF-8'}</span><p>
|
||||
</div>
|
||||
|
||||
<h3 class="sale-title-type col-xs-12 smobile"><span>{l s='Nos ventes en cours' mod='privatesales'}</span></h3>
|
||||
{if $currentsales|count > 0}
|
||||
<div class="privatesales-slider">
|
||||
{hook h='displaySlider' mod='advslider'}
|
||||
</div>
|
||||
{assign var=i value=0}
|
||||
{foreach $currentsales as $sale}
|
||||
{if isset($slider_active) && $slider_active && ($currentsales|count == 1 || $i == 0)}
|
||||
<div class="row slider-ctn">
|
||||
{*desktop*}
|
||||
<div id="slider_home" class="clearfix snotmobile">
|
||||
<div class="clearfix owl">
|
||||
{foreach from=$slider item=slide key=key name=slider}
|
||||
<div class="col-sm-12 slide-home item " {if isset($slide.img) && $slide.img!='slider/slider_{$key}_.png'}style="height:300px;background: url('{$img_dir}{$slide.img}') no-repeat left top; background-size: 100% auto;"{/if}>
|
||||
{if isset($slide.link) && $slide.link}
|
||||
<a class="" href="{$slide.link}" style="width:100%;height: 100%;display: block;" {if isset($slide.title) && $slide.title}title="{$slide.title}"{/if}></a>
|
||||
{/if}
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
{*mobile*}
|
||||
<div id="slider_home_mobile" class="clearfix smobile">
|
||||
<div class="clearfix owl">
|
||||
{foreach from=$slider item=slide key=key name=slider}
|
||||
<div class="col-sm-12 slide-home item" {if isset($slide.img_mobile) && $slide.img_mobile!='slider/slider_{$key}_.png'}style="height:200px;background: url('{$img_dir}{$slide.img_mobile}') no-repeat center top; background-size: contain;"{/if}>
|
||||
{if isset($slide.link) && $slide.link}
|
||||
<a class="" {if !$cookie->logged}onclick="window.location.href='{$link->getPageLink('authentication', true)|escape:'html':'UTF-8'}';"{else}href="{$slide.link}"{/if} style="width:100%;height: 100%;display: block;" {if isset($slide.title) && $slide.title}title="{$slide.title}"{/if}></a>
|
||||
{/if}
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{capture name=img_sale}{$base_dir}{$link_img}{$sale->id}/current/{$sale->id}_{$cookie->id_lang}.jpg{/capture}
|
||||
{if !$sale->news}
|
||||
{if strtotime($sale->date_end) < (strtotime(date('Y-m-d H:i:s')) + (3600 * 24 * 2))}
|
||||
@ -92,7 +67,7 @@ $(document).ready(function() {
|
||||
{else}
|
||||
<div class="sale {if $sale->univers}sale_univers{/if} {if $i == 0}first{/if}" id="sale_{$sale->id}" >
|
||||
{/if}
|
||||
<div class="sale_container clearfix" {if isset($sales_mobile) && $sales_mobile && !$cookie->logged}onclick="window.location.href='{$link->getPageLink('authentication', true)|escape:'html':'UTF-8'}';"{/if}>
|
||||
<div class="sale_container clearfix"{if isset($sales_mobile) && $sales_mobile && !$cookie->logged} onclick="window.location.href='{$link->getPageLink('authentication', true)|escape:'html':'UTF-8'}?create_account=1';"{/if}>
|
||||
{if $sale->concours && strtotime($sale->date_start) >= {mktime(strftime('%H') - $sale->concours_delay)}}
|
||||
<div class="picto-concours">
|
||||
<a href="{$sale->link}"></a>
|
||||
@ -154,7 +129,7 @@ $(document).ready(function() {
|
||||
{else}
|
||||
<div class="sale {if isset($sale->news) && $sale->news}is_news{/if} {if $sale->univers}sale_univers{/if} {if $i == 0}first{/if}" id="sale_{$sale->id}">
|
||||
{/if}
|
||||
<div class="sale_container clearfix" {if $sales_mobile && !$cookie->logged}onclick="window.location.href='{$link->getPageLink('authentication', true)|escape:'html':'UTF-8'}';"{/if} style="{if $sale->image}background : url('{$smarty.capture.img_sale}') no-repeat 0 0 / 230% 100% {/if}">
|
||||
<div class="sale_container clearfix"{if $sales_mobile && !$cookie->logged} onclick="window.location.href='{$link->getPageLink('authentication', true)|escape:'html':'UTF-8'}?create_account=1';"{/if} style="{if $sale->image}background : url('{$smarty.capture.img_sale}') no-repeat 0 0 / 230% 100% {/if}">
|
||||
{if $sale->image}<img class="img_sale snotmobile" src="{$smarty.capture.img_sale}" />{/if}
|
||||
<div class="snotmobile new-block clearfix" {if !$sale->univers && $cookie->logged}onclick="window.location.href='{$sale->link}';"{/if} >
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user