modif vente flash

This commit is contained in:
Romu 2017-01-16 03:43:08 -08:00
parent 2930dffe00
commit bfbe754420
13 changed files with 657 additions and 883 deletions

View File

@ -101,14 +101,14 @@ class AdvMenu extends Module
{
if(Context::getContext()->controller instanceOf IndexController)
{
if (!$this->isCached('advmenu.tpl', $this->getCacheId('advmenu_'.$params['isCms']))) {
if (!$this->isCached('advmenu.tpl', $this->getCacheId('advmenu_'.$params['isCms'].'_'.$params['isFlashsalesPage']))) {
$menuLinks = AdvMenuLink::getMenu();
if (!$menuLinks) {
return false;
}
$this->smarty->assign('menuLinks', $menuLinks);
}
return $this->display(__FILE__, 'advmenu.tpl', $this->getCacheId('advmenu_'.$params['isCms']));
return $this->display(__FILE__, 'advmenu.tpl', $this->getCacheId('advmenu_'.$params['isCms'].'_'.$params['isFlashsalesPage']));
}
else
{
@ -118,17 +118,19 @@ class AdvMenu extends Module
}
}
public function loadMenu($isCms)
public function loadMenu($isCms, $isFlashsalesPage)
{
$this->smarty->assign('isCms', (int) $isCms);
if (!$this->isCached('advmenu.tpl', $this->getCacheId('advmenu_'.$isCms))) {
$this->smarty->assign('isFlashsalesPage', (int) $isFlashsalesPage);
if (!$this->isCached('advmenu.tpl', $this->getCacheId('advmenu_'.$isCms.'_'.$isFlashsalesPage))) {
$menuLinks = AdvMenuLink::getMenu();
if (!$menuLinks) {
return false;
}
$this->smarty->assign('menuLinks', $menuLinks);
}
return $this->display(__FILE__, 'advmenu.tpl', $this->getCacheId('advmenu_'.$isCms));
return $this->display(__FILE__, 'advmenu.tpl', $this->getCacheId('advmenu_'.$isCms.'_'.$isFlashsalesPage));
}
public function hookHeader($params)

View File

@ -4,5 +4,5 @@ require dirname(dirname(__FILE__)).'/../init.php';
require dirname(__FILE__).'/advmenu.php';
$module = new AdvMenu();
echo $module->loadMenu(Tools::getValue('isCms'));
echo $module->loadMenu(Tools::getValue('isCms'), Tools::getValue('isFlashsalesPage'));
die;

View File

@ -69,8 +69,11 @@ class FlashsalesPageModuleFrontController extends ModuleFrontController
$this->productSort();
$products = FlashSale::getAllProducts($id_lang, $id_flash_sale, 'page', false, $this->p - 1, $this->n, $this->orderBy, $this->orderWay);
$nbProducts = (int)count($products);
$this->p = (int)Tools::getValue('p', 1);
$products = FlashSale::getAllProducts($id_lang, $id_flash_sale, 'page', false, $this->p - 1, Configuration::get('PS_PRODUCT_PER_PAGE'), $this->orderBy, $this->orderWay);
$all_products = FlashSale::getAllProducts($id_lang, $id_flash_sale, 'page', false, 0, 3000, $this->orderBy, $this->orderWay); // A opti, deux fois la même requete
$nbProducts = (int)count($all_products);
$this->pagination($nbProducts);

File diff suppressed because it is too large Load Diff

View File

@ -1,280 +1 @@
/*----------------------------------------------------------------------------
Coundown box
---------------------------------------------------------------------------*/
.flashsale-countdown-box {
width: 100%;
background-color: #3b3b3b;
border-width: 10px;
border-color: #2c2c2c;
border-style: solid;
margin-left: auto;
margin-right: auto;
text-align: center;
padding: 10px 5px;
margin: 10px auto;
}
.flashsale-countdown-box .content i.icon-clock-o {
font-size: 20px;
color: #9be300;
display: inline-block;
vertical-align: middle;
}
.flashsale-countdown-box .content span.title {
font-size: 16px;
color: #ffffff;
text-transform: uppercase;
font-weight: 600;
display: inline-block;
vertical-align: middle;
}
.flashsale-countdown-box .content span.countdown {
color: #ffffff;
display: inline-block;
vertical-align: middle;
}
.flashsale-countdown-box .content span.timer {
font-size: 18px;
}
/*----------------------------------------------------------------------------
Column
---------------------------------------------------------------------------*/
.flashsale-column.block {
margin-bottom: 30px;
}
.flashsale-column.block .title_block {
font: 600 18px/22px "Open Sans", sans-serif;
color: #555454;
background: #f6f6f6;
border-top: 5px solid #333;
text-transform: uppercase;
padding: 14px 5px 17px 20px;
margin-bottom: 20px;
}
.flashsale-column.block .title_block a{
color: #555454;
}
.flashsale-column.block .content_block li {
padding: 0 0 20px 0;
margin-bottom: 20px;
border-bottom: 1px solid #d6d4d4;
}
.flashsale-column.block .content_block li .product-image {
float: left;
border: 1px solid #d6d4d4;
margin-right: 19px;
}
.flashsale-column.block .content_block li .product-content {
overflow: hidden;
}
.flashsale-column.block .content_block li .product-content .product-name {
font-size: 15px;
line-height: 18px;
color: #3a3939;
margin: -3px 0 0 0;
}
.flashsale-column.block .content_block li .product-content .product-description {
margin-bottom: 14px;
}
.flashsale-column.block .content_block li .product-content .product-price .price {
font-size: 13px;
color: #777;
white-space: nowrap;
}
.flashsale-column.block .content_block li .product-content .product-price .special-price {
color: #f13340;
}
.flashsale-column.block .content_block li .product-content .product-price .price-percent-reduction {
font: 700 14px/17px Arial, Helvetica, sans-serif;
padding: 1px 6px;
background: #f13340;
border: 1px solid #d02a2c;
color: #fff;
display: inline-block;
}
.flashsale-column.block .content_block li .product-content .product-price .old-price {
color: #6f6f6f;
text-decoration: line-through;
}
/*----------------------------------------------------------------------------
Page
---------------------------------------------------------------------------*/
.flashsale-page .page-heading {
font: 600 18px/22px "Open Sans", sans-serif;
color: #555454;
text-transform: uppercase;
padding: 0px 0px 17px 0px;
margin-bottom: 30px;
border-bottom: 1px solid #d6d4d4;
overflow: hidden;
}
.flashsale-page h5 {
margin-top: 9px;
margin-bottom: 9px;
font-family: Arial, Helvetica, sans-serif;
font-weight: 500;
line-height: 1.1;
font-size: 13px;
}
.flashsale-page ul {
margin: 0 0 0 -20px;
}
.flashsale-page ul li {
margin-bottom: 20px;
}
.flashsale-page ul li .content_list {
max-width: 137px;
margin: auto;
text-align: center
}
.flashsale-page ul li .content_list .content_image {
position: relative;
width: 125px;
height: 125px;
}
.flashsale-page ul li .content_list .content_image a {
padding: 5px;
display: block;
width: 100%;
height: 100%;
border: 1px solid #d6d4d4;
}
.flashsale-page ul li .content_list .content_image a .content_reduction {
display: block;
height: 100%;
background-color: #CA427E;
padding: 15px 0 0 0;
}
.flashsale-page ul li .content_list .content_image a .content_reduction span {
color: #fff;
font-size: 18px
}
.flashsale-page ul li .content_list .content_image a .content_reduction span.reduction {
display: block;
font-size: 24px;
font-weight: 800;
margin-top: 15px;
}
.flashsale-page ul li .content_list .content_image a .content_reduction hr {
width: 60%;
margin-top: 18px;
border: 0;
border-top: 3px solid #eeeeee;
}
.flashsale-page ul li .content_list .content_image a:hover,
.flashsale-page ul li.selected .content_list .content_image a{
outline: 3px solid #333;
}
.flashsale-page ul li .content_list .content_name {
font: 600 14px/16px "Open Sans", sans-serif;
color: #555454;
text-transform: uppercase;
}
/*----------------------------------------------------------------------------
Home
---------------------------------------------------------------------------*/
.flashsale-home .content_block {
margin: 8px 0;
padding: 5px;
border: 1px solid #d6d4d4;
}
.flashsale-home .content_block .right_block .flashsale-countdown-box {
margin-bottom: 0;
}
.flashsale-home .content_block .left_block {
background-color: #444;
height: 200px;
}
.flashsale-home .content_block .left_block img {
height: 100%;
width: 100%;
margin:auto;
}
.flashsale-home .content_block .left_block .banner_content {
padding: 18px 10px 10px 42px;
}
.flashsale-home .content_block .left_block .banner_name {
font: 600 38px/48px "Open Sans", sans-serif;
color: white;
}
.flashsale-home .content_block .left_block .banner_description {
background: transparent none repeat scroll 0 0;
margin-top: 12px;
}
@media (min-width: 992px) {
.flashsale-home .content_block {
height: 212px;
}
.flashsale-home .content_block .right_block {
height: 200px;
vertical-align: middle;
display: table-cell;
width: 100%
}
.flashsale-home .content_block .right_block .flashsale-countdown-box .countdown {
display: block
}
}
.flashsale-home .content_block .right_block button {
margin-top: 20px;
width: 100%;
color: #fff;
background-color: #CA427E;
border-color: #CA427E;
display: inline-block;
padding: 6px 12px;
margin-bottom: 0;
font-size: 13px;
font-weight: normal;
line-height: 1.42857;
text-align: center;
vertical-align: middle;
cursor: pointer;
border: 1px solid transparent;
border-radius: 0px;
-webkit-user-select
}
.flashsale-home .content_block .right_block button a {
color: white;
text-transform: uppercase;
font-size: 14px;
font-weight: 600;
}
/**/

View File

@ -110,6 +110,14 @@ class FrontController extends FrontControllerCore
$this->context->smarty->assign('isCms', 0);
}
if ($this->context->controller instanceof FlashsalesPageModuleFrontController) {
$this->context->isFlashsalesPage = 1;
$this->context->smarty->assign('isFlashsalesPage', 1);
} else {
$this->context->isFlashsalesPage = 0;
$this->context->smarty->assign('isFlashsalesPage', 0);
}
parent::init();
}
}

View File

@ -165,6 +165,7 @@ body.content_only { margin: 0 }
display:none;
}
#header #mainmenu .menu-content.active { display: block; text-align: center; }
#module-flashsales-page #header #mainmenu .menu-content.active { display: none }
#header #mainmenu .menu-content li {
display: inline-block;
vertical-align: middle;
@ -1150,10 +1151,14 @@ body .ac_results {
.newsletter_footer p { display: none; }
#header .tabs { position: absolute; right: 7px; bottom: 60px; width: 50%; font-size: 0;}
#header .tabWrap { position: relative; height: 50px; }
#header .tabs li { display: inline-block; width: 50%;}
#header .tabs li a { background: #fff; border-radius: 2px; color: #222; display: block; font-family: 'pompiere_regular'; font-size: 22px; margin: 0 8px; padding: 6px 30px 4px 15px; text-decoration: none; text-transform: uppercase; text-align: left; }
#header .bg-pink { padding: 15px 0 30px 0 }
#header .tabs { position: absolute; right: 7px; bottom: 0; width: 50%; font-size: 0;}
#header .tabWrap { position: relative; }
#header .tabs ul { margin: 0 -8px }
#header .tabs li { display: inline-block; margin-bottom: 10px; padding: 0 8px; width: 50%;}
#header .tabs li:last-child { width:100%;}
#header .tabs li a { background: #fff; border-radius: 2px; color: #222; display: block; font-family: 'pompiere_regular'; font-size: 22px; padding: 6px 30px 4px 15px; text-decoration: none; text-transform: uppercase; text-align: left; }
#header .tabs li:last-child a { text-align: center }
#header .tabs li a:before { content: "\e903"; font-family: 'icomoon'; font-size: 20px; display: inline-block; margin: 2px 10px 0 0; }
#header #menu-mobile { float: left; z-index: 100; }
@ -1200,7 +1205,7 @@ body .ac_results {
#header #search_block_left .icon-search { padding-right: 0; }
#header .search_box { padding-left: 15px; margin-bottom: 0; }
#header .bg-pink, #header .bg-blue { padding-bottom: 5px; }
#header .tabs { padding: 0 0 15px 0; position: static; text-align: center; width: 100%;}
#header .tabs { position: static; text-align: center; width: 100%;}
#header .tabs li { display: inline-block; }
#header .tabs li a { font-size: 18px; padding: 6px 15px 4px 15px; }
#header .tabs li a:before { font-size: 16px; }
@ -2517,7 +2522,7 @@ main#categorycms { margin-bottom: 30px }
/* background: #f1f1f1; */
}
#postedito .pack_content.discount { border: 2px solid #ffd51b }
#postedito .pack_content.flash { border: 2px solid #6ac5bb }
#postedito .pack_content.flash { border: 2px solid #e4535d }
#postedito .pack_content .image {
padding: 25px 15px;
}
@ -2546,7 +2551,7 @@ main#categorycms { margin-bottom: 30px }
line-height: 18px;
}
#postedito .pack_content .content_product .product-flashsale .flashsale-countdown-box {
background: #6ac5bb;
background: #e4535d;
color: #fff;
font-family: 'pt_sans';
font-size: 18px;
@ -2583,7 +2588,7 @@ main#categorycms { margin-bottom: 30px }
text-align: left;
top: 10px;
}
#postedito .flash .price-percent-reduction { background: #6ac5bb }
#postedito .flash .price-percent-reduction { background: #e4535d }
#postedito .price-percent-reduction span {
color: #514b2f;
font-size: 13px;
@ -7735,8 +7740,12 @@ div.languages>span{
float: left;
margin: 0 15px 15px 15px;
}
#module-flashsales-page .page-heading .listing-flashsales .flashsale-btn .btn {
border-color: #e4535d
}
#module-flashsales-page .page-heading .listing-flashsales .flashsale-btn .btn:hover { background: #e4535d; color: #fff }
#module-flashsales-page .page-heading .listing-flashsales .flashsale-btn.active .btn {
background: #6ac5bb;
background: #e4535d;
color: #fff;
}
.feature-flashsale {

View File

@ -658,7 +658,7 @@ header.page-heading.order-process { padding: 25px 0 0 0 }
position: relative;
}
.bloc.product-container .border.discount { border: 5px solid #ffd51b }
.flash.bloc.product-container .border.discount { border: 5px solid #6ac5bb }
.flash.bloc.product-container .border.discount { border: 5px solid #e4535d }
.bloc.product-container .border .price-percent-reduction {
padding: 7px 15px 3px 15px;
@ -671,7 +671,7 @@ header.page-heading.order-process { padding: 25px 0 0 0 }
font-family: 'pt_sans';
}
.flash.product-container .border .price-percent-reduction { background: #6ac5bb }
.flash.product-container .border .price-percent-reduction { background: #e4535d }
.bloc.product-container .border .price-percent-reduction span {
color: #514b2f;
}
@ -888,13 +888,13 @@ header.page-heading.order-process { padding: 25px 0 0 0 }
height: 40px;
}
.product-container .product-flashsale .flashsale-countdown-box {
background: #6ac5bb url('../img/timer.png') no-repeat 15px 8px;
background: #e4535d url('../img/timer.png') no-repeat 15px 8px;
color: #fff;
font-family: 'pt_sans';
font-size: 18px;
padding: 9px 15px 3px 85px;
}
.column.bloc.product-container .product-flashsale .flashsale-countdown-box { background: #6ac5bb; font-size: 16px; padding: 9px 15px 3px 15px }
.column.bloc.product-container .product-flashsale .flashsale-countdown-box { background: #e4535d; font-size: 16px; padding: 9px 15px 3px 15px }
/* /height */
@ -1454,3 +1454,31 @@ body .fancybox-overlay {
#search_result_container_result_products.on_search li:first-child, #search_result_container_result_tricks.on_search li:first-child {
padding: 0;
}
/* Blink */
@-webkit-keyframes blink {
0% { opacity: 1 }
50% { opacity: 0 }
100%{ opacity: 1 }
}
@-moz-keyframes blink {
0% { opacity: 1 }
50% { opacity: 0 }
100%{ opacity: 1 }
}
@-o-keyframes blink {
0% { opacity: 1 }
50% { opacity: 0 }
100%{ opacity: 1 }
}
@keyframes blink {
0% { opacity: 1 }
50% { opacity: 0 }
100%{ opacity: 1 }
}
.blink {
-webkit-animation: blink 1s infinite;
-moz-animation: blink 1s infinite;
-o-animation: blink 1s infinite;
animation: blink 1s infinite;
}

View File

@ -180,6 +180,6 @@
</div>
</div>
{hook h='displayMenu' isCms=$isCms}
{hook h='displayMenu' isCms=$isCms isFlashsalesPage=$isFlashsalesPage}
</header>
{/if}

View File

@ -6,9 +6,11 @@
{foreach $menuLinks item='tabLink' name='tabLink'}
<li>
{if $tabLink.id_link == AdvMenuLink::ID_CMS}
<a href="{$base_uri}" class="menu-mobile menu-cms{if $isCms} active{/if}"><span>{$tabLink.title}</span></a>
<a href="{$base_uri}" class="menu-mobile menu-cms{if $isCms && !$isFlashsalesPage} active{/if}"><span>{$tabLink.title}</span></a>
{elseif $tabLink.id_link == AdvMenuLink::ID_BOUTIQUE}
<a href="{$base_uri}{$tabLink.url}" class="menu-mobile menu-boutique{if !$isCms && !$isFlashsalesPage} active{/if}"><span>{$tabLink.title}</span></a>
{else}
<a href="{$base_uri}{$tabLink.url}" class="menu-mobile menu-boutique{if !$isCms} active{/if}"><span>{$tabLink.title}</span></a>
<a href="{$base_uri}{$tabLink.url}" class="menu-flashsales {if $isFlashsalesPage} active{/if}"><span>{$tabLink.title}</span></a>
{/if}
</li>
{/foreach}

View File

@ -2,12 +2,13 @@
{addJsDef menuAjaxUrl=$url_ajax}
{addJsDef isCms=$isCms}
{addJsDef isFlashsalesPage=$isFlashsalesPage}
<script>
$(document).ready(function(e) {
$.ajax({
method: "POST",
url: menuAjaxUrl,
data: { isCms: isCms },
data: { isCms: isCms, isFlashsalesPage: isFlashsalesPage },
success: function(data) {
$('.load_menu').html(data);
if(isMobile) {

View File

@ -58,8 +58,8 @@
<div class="row">
{include file="$tpl_dir./product-list-blocs.tpl" products=$products}
</div>
{include file="$tpl_dir./pagination.tpl"}
</div>
{include file="$tpl_dir./pagination.tpl"}
{else}
<p class="alert alert-warning">{l s='No flash sales at this time.' mod='flashsales'}</p>
{/if}

View File

@ -21,7 +21,7 @@
<div class="row">
<div class="{if !isset($column)}col-xs-4 col-xxs-4 {else} col-xs-5 col-xxs-5 {/if}wrapImg">
{if $percentReduction}
<span class="price-percent-reduction">
<span class="price-percent-reduction{if isset($product.isflash) && $product.isflash} blink{/if}">
<span class="reduction-label">
{if isset($product.isflash) && $product.isflash}
{l s='Vente Flash'} |