Merge branch 'ticket/r13756-slider' into dev

This commit is contained in:
Michael RICOIS 2017-09-05 10:01:39 +02:00
commit 183cc2e57d
3 changed files with 35 additions and 8 deletions

View File

@ -109,7 +109,7 @@ class AdvSlide extends ObjectModel
$groups = array(Configuration::get('ADVSLIDER_DEFAULT_GROUP'));
}
$sql.= ' AND EXISTS(SELECT * FROM `'._DB_PREFIX_.'advslider_group` ag WHERE ag.id_group IN('.join(',', $groups).'))';
$sql.= ' AND adv.`id_slide` IN (SELECT `id_slide` FROM `'._DB_PREFIX_.'advslider_group` ag WHERE ag.id_group IN('.join(',', $groups).'))';
}
// Check date

View File

@ -6,7 +6,7 @@ class SaleCache
private $smarty = null;
private $max_filemtime = 0;
private $template_path = '';
private $path_cache = '';
private $path_cache_file = '';
function __construct(Context $context, $cache_prefix, $lifetime, $is_sales_news = null)
{
@ -70,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;
}

View File

@ -53,14 +53,41 @@ $(document).ready(function() {
<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>
<div class="mon-nouveau-slider">
{hook h='displaySlider' mod='advslider'}
</div>
<h3 class="sale-title-type col-xs-12 smobile"><span>{l s='Nos ventes en cours' mod='privatesales'}</span></h3>
<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))}