Merge branch 'master' of gitlab.antadis.net:dev-antadis/privilegedemarque

This commit is contained in:
Srv Privilege de marque 2017-08-02 10:58:15 +02:00
commit 719b0aa743
4 changed files with 163 additions and 224 deletions

View File

@ -35,20 +35,18 @@ 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->mobile_detect->isMobile() && !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);
if (isset($this->context->cookie->just_logged_in)) {
@ -88,10 +86,9 @@ 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
{
$cookie_name_popup_shipping = 'p-fsh';
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])
&& !Validate::isLoadedObject($this->context->customer))
{
@ -124,8 +121,8 @@ class FrontController extends FrontControllerCore
if(count($errors) == 0)
{
$res = Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'customer
SET
$res = Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'customer
SET
passwd = "'.pSQL(Tools::encrypt($password)).'",
pro_update = 1
WHERE id_customer = '.$this->context->customer->id);
@ -148,7 +145,7 @@ class FrontController extends FrontControllerCore
$error_popup = false;
if( $this->context->customer->firstname == 'Membre' && $this->context->customer->lastname == 'Privilégié' && $page_name == "order"){
$launch_popup = true;
}
}
if(Tools::isSubmit('SubmitChangeName')){
$launch_popup = true;
$error_popup = true;

View File

@ -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;
});
$(".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>
}
});
$(".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();
}
});
$("#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");
}
});
$(".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}

View File

@ -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&amp;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}
@ -304,8 +287,7 @@
{/literal}
{elseif $page_name == 'product'}
{literal}
<script type="text/javascript">
<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&amp;ev=PageView&amp;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">

View File

@ -92,7 +92,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 +154,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} >