Merge branch 'ticket-GAnalytics' into develop

This commit is contained in:
Marion Muszynski 2016-09-20 18:00:48 +02:00
commit 9673ff3805
3 changed files with 278 additions and 217 deletions

View File

@ -26,225 +26,258 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#" xml:lang="{$lang_iso}"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#" xml:lang="{$lang_iso}">
<head> <head>
<title>{$meta_title|escape:'htmlall':'UTF-8'}</title> <title>{$meta_title|escape:'htmlall':'UTF-8'}</title>
{if isset($meta_description) AND $meta_description} {if isset($meta_description) AND $meta_description}
<meta name="description" content="{$meta_description|escape:html:'UTF-8'}" /> <meta name="description" content="{$meta_description|escape:html:'UTF-8'}" />
{/if} {/if}
{if isset($meta_keywords) AND $meta_keywords} {if isset($meta_keywords) AND $meta_keywords}
<meta name="keywords" content="{$meta_keywords|escape:html:'UTF-8'}" /> <meta name="keywords" content="{$meta_keywords|escape:html:'UTF-8'}" />
{/if} {/if}
{if isset($meta_fb_img) AND $meta_fb_img} {if isset($meta_fb_img) AND $meta_fb_img}
<meta property="og:image" content="{$meta_fb_img|escape:html:'UTF-8'}" /> <meta property="og:image" content="{$meta_fb_img|escape:html:'UTF-8'}" />
{/if} {/if}
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<meta name="robots" content="{if isset($nobots)}no{/if}index,follow" /> <meta name="robots" content="{if isset($nobots)}no{/if}index,follow" />
<link rel="icon" type="image/png" href="{$img_ps_dir}preview.png?{$img_update_time}" /> <link rel="icon" type="image/png" href="{$img_ps_dir}preview.png?{$img_update_time}" />
<link rel="icon" type="image/vnd.microsoft.icon" href="{$img_ps_dir}favicon.ico?{$img_update_time}" /> <link rel="icon" type="image/vnd.microsoft.icon" href="{$img_ps_dir}favicon.ico?{$img_update_time}" />
<link rel="shortcut icon" type="image/x-icon" href="{$img_ps_dir}favicon.ico?{$img_update_time}" /> <link rel="shortcut icon" type="image/x-icon" href="{$img_ps_dir}favicon.ico?{$img_update_time}" />
{if isset($page_name) && $page_name == 'authentication'} {if isset($page_name) && $page_name == 'authentication'}
<link rel="canonical" href="{$link->getPageLink('authentication.php', TRUE)}" /> <link rel="canonical" href="{$link->getPageLink('authentication.php', TRUE)}" />
{/if} {/if}
<script type="text/javascript"> <script type="text/javascript">
var baseDir = '{$content_dir}'; var baseDir = '{$content_dir}';
var static_token = '{$static_token}'; var static_token = '{$static_token}';
var token = '{$token}'; var token = '{$token}';
var priceDisplayPrecision = {$priceDisplayPrecision*$currency->decimals}; var priceDisplayPrecision = {$priceDisplayPrecision*$currency->decimals};
var priceDisplayMethod = {$priceDisplay}; var priceDisplayMethod = {$priceDisplay};
var roundMode = {$roundMode}; var roundMode = {$roundMode};
var isoLang = "{$lang_iso}"; var isoLang = "{$lang_iso}";
</script> </script>
{if isset($css_files)} {if isset($css_files)}
{foreach from=$css_files key=css_uri item=media} {foreach from=$css_files key=css_uri item=media}
<link href="{$css_uri}" rel="stylesheet" type="text/css" media="{$media}" /> <link href="{$css_uri}" rel="stylesheet" type="text/css" media="{$media}" />
{/foreach} {/foreach}
{/if} {/if}
{if isset($js_files)} {if isset($js_files)}
{foreach from=$js_files item=js_uri} {foreach from=$js_files item=js_uri}
<script type="text/javascript" src="{$js_uri}"></script> <script type="text/javascript" src="{$js_uri}"></script>
{/foreach} {/foreach}
{/if} {/if}
<link rel="apple-touch-icon" href="{$base_dir_ssl}img/apple-touch-icon.png" /> <link rel="apple-touch-icon" href="{$base_dir_ssl}img/apple-touch-icon.png" />
{$HOOK_HEADER} {$HOOK_HEADER}
<!--[if IE 7]> <!--[if IE 7]>
<link href="{$css_dir}ie7.css" rel="stylesheet" type="text/css" media="screen" /> <link href="{$css_dir}ie7.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]--> <![endif]-->
<!--[if IE 8]> <!--[if IE 8]>
<link href="{$css_dir}ie8.css" rel="stylesheet" type="text/css" media="screen" /> <link href="{$css_dir}ie8.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]--> <![endif]-->
<!--[if IE 9]> <!--[if IE 9]>
<link href="{$css_dir}ie9.css" rel="stylesheet" type="text/css" media="screen" /> <link href="{$css_dir}ie9.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]--> <![endif]-->
{if $cookie->id_lang == 2} {if $cookie->id_lang == 2}
{literal} {literal}
<script> <script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-30665119-1', 'auto'); ga('create', 'UA-30665119-1', 'auto');
{/literal}{if isset($page_name) && $page_name == 'order'}{literal} {/literal}{if isset($page_name) && $page_name == 'order'}{literal}
ga('require', 'ec'); ga('require', 'ec');
{/literal}{if $step == 0}{literal} {/literal}
{/literal}{if $cart} {if $step == 0 || $step == 1}
{assign var='cartProducts' value=$cart->getProducts()}{literal} {if $cart}
{/literal}{foreach from=$cartProducts item=cartProduct}{literal} {assign var='cartProducts' value=$cart->getProducts()}
ga('ec:addProduct', { {foreach from=$cartProducts item=cartProduct}
'id': {/literal}{$cartProduct['id_product']}{literal}, {literal}
'name': "{/literal}{$cartProduct['name']}{literal}", ga('ec:addProduct', {
'category': "{/literal}{$cartProduct['category']}{literal}", 'id': {/literal}{$cartProduct['id_product']}{literal},
'price': {/literal}{Tools::ps_round(Product::getPriceStatic((int)$cartProduct['id_product'], true, ((isset($cartProduct['id_product_attribute']) AND !empty($cartProduct['id_product_attribute'])) ? (int)($cartProduct['id_product_attribute']) : NULL), 2), 2)}{literal}, 'name': "{/literal}{$cartProduct['name']}{literal}",
'quantity': {/literal}{$cartProduct['cart_quantity']}{literal} 'category': "{/literal}{$cartProduct['category']}{literal}",
}); 'price': {/literal}{Tools::ps_round(Product::getPriceStatic((int)$cartProduct['id_product'], true, ((isset($cartProduct['id_product_attribute']) AND !empty($cartProduct['id_product_attribute'])) ? (int)($cartProduct['id_product_attribute']) : NULL), 2), 2)}{literal},
{/literal}{/foreach}{literal} 'quantity': {/literal}{$cartProduct['cart_quantity']}{literal}
{/literal}{/if}{literal} });
ga('ec:setAction','checkout', { {/literal}
'step': 1, {/foreach}
}); {/if}
{/literal}{else if $step == 1}{literal} {/if}
ga('ec:setAction','checkout', { {literal}
'step': 2,
});
{/literal}{else if $step == 2}{literal}
ga('ec:setAction','checkout', {
'step': 3,
});
{/literal}{else if $step == 3}{literal}
ga('ec:setAction','checkout', {
'step': 4,
});
{/literal}{/if}
{/if}{literal}
ga('send', 'pageview'); {/literal}{if $step == 0}{literal}
</script> //cart
{/literal} ga('ec:setAction','checkout', {
{elseif $cookie->id_lang == 3} 'step': 1,
{literal} });
<script> {/literal}{else if $step == 1}{literal}
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ // address
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), ga('ec:setAction','checkout', {
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 'step': 2,
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); });
{/literal}{else if $step == 2}{literal}
// carrier
ga('ec:setAction','checkout', {
'step': 3,
});
{/literal}{else if $step == 3}{literal}
// payment
ga('ec:setAction','checkout', {
'step': 4,
});
{/literal}{/if}
{/if}{literal}
ga('create', 'UA-68580471-1', 'auto'); ga('send', 'pageview');
ga('send', 'pageview');
</script>
{/literal}
{/if}
<!-- Facebook Pixel Code --> function onStepComplete(stepNumber, option, redirect, form) {
{if $cookie->id_lang == 2} ga('ec:setAction', 'checkout_option', {
{literal} 'step': stepNumber,
<script> 'option': option
!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; if (redirect != null) {
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0; ga('send', 'event', 'Checkout', 'Option', {
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, hitCallback: function() {
document,'script','//connect.facebook.net/en_US/fbevents.js'); document.location = redirect;
}
});
} else if (form != null) {
ga('send', 'event', 'Checkout', 'Option', {
hitCallback: function() {
form.submit();
}
});
} else {
ga('send', 'event', 'Checkout', 'Option', {});
}
}
</script>
{/literal}
{elseif $cookie->id_lang == 3}
{literal}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
fbq('init', '585280634957856'); ga('create', 'UA-68580471-1', 'auto');
fbq('track', "PageView"); ga('send', 'pageview');
</script> </script>
{/literal} {/literal}
<noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=585280634957856&amp;ev=PageView&amp;noscript=1"/></noscript> {/if}
{elseif $cookie->id_lang == 3}
{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', '778018572325168'); <!-- Facebook Pixel Code -->
fbq('track', "PageView"); {if $cookie->id_lang == 2}
</script> {literal}
{/literal} <script>
<noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=778018572325168&amp;ev=PageView&amp;noscript=1"/></noscript> !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
{/if} 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');
{literal} fbq('init', '585280634957856');
<script> fbq('track', "PageView");
fbq('track', 'ViewContent', { </script>
content_name:'{/literal}{$page_name|escape:'html':'UTF-8'}{literal}' {/literal}
}); <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=585280634957856&amp;ev=PageView&amp;noscript=1"/></noscript>
</script> {elseif $cookie->id_lang == 3}
{/literal} {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');
{if isset($smarty.get.validation)} fbq('init', '778018572325168');
{literal} fbq('track', "PageView");
<script> </script>
fbq('track', 'CompleteRegistration'); {/literal}
</script> <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=778018572325168&amp;ev=PageView&amp;noscript=1"/></noscript>
{/literal} {/if}
{/if}
{if isset($page_name)} {literal}
{if $page_name == 'order-confirmation' && isset($order)} <script>
{literal} fbq('track', 'ViewContent', {
<script> content_name:'{/literal}{$page_name|escape:'html':'UTF-8'}{literal}'
fbq('track', 'Purchase', { });
value: '{/literal}{$order->total_paid}{literal}', </script>
currency: "{/literal}{$currency['name']}{literal}" {/literal}
});
</script>
{/literal}
{/if}
{/if}
<!-- End Facebook Pixel Code -->
<!-- crazyegg --> {if isset($smarty.get.validation)}
{literal} {literal}
<script type="text/javascript"> <script>
setTimeout(function(){var a=document.createElement("script"); fbq('track', 'CompleteRegistration');
var b=document.getElementsByTagName("script")[0]; </script>
a.src=document.location.protocol+"//script.crazyegg.com/pages/scripts/0047/9841.js?"+Math.floor(new Date().getTime()/3600000); {/literal}
a.async=true;a.type="text/javascript";b.parentNode.insertBefore(a,b)}, 1); {/if}
</script>
{/literal}
</head> {if isset($page_name)}
{if $page_name == 'order-confirmation' && isset($order)}
{literal}
<script>
fbq('track', 'Purchase', {
value: '{/literal}{$order->total_paid}{literal}',
currency: "{/literal}{$currency['name']}{literal}"
});
</script>
{/literal}
{/if}
{/if}
<!-- End Facebook Pixel Code -->
<body {if $page_name}id="{$page_name|escape:'htmlall':'UTF-8'}"{/if} class="{$bodyClass}{if $cookie->isLogged()} logged{/if}{if isset($smarty.get.content_only)} content_only{/if}{if isset($smarty.post.email_create) || isset($smarty.get.create_account)} create{/if} lang{$cookie->id_lang}"> <!-- crazyegg -->
{literal}
<script type="text/javascript">
setTimeout(function(){var a=document.createElement("script");
var b=document.getElementsByTagName("script")[0];
a.src=document.location.protocol+"//script.crazyegg.com/pages/scripts/0047/9841.js?"+Math.floor(new Date().getTime()/3600000);
a.async=true;a.type="text/javascript";b.parentNode.insertBefore(a,b)}, 1);
</script>
{/literal}
{if !$content_only} </head>
{if isset($restricted_country_mode) && $restricted_country_mode}
<div id="restricted-country">
<p>{l s='You cannot place a new order from your country.'} <span class="bold">{$geolocation_country}</span></p>
</div>
{/if}
<div id="page">
<!-- Header --> <body {if $page_name}id="{$page_name|escape:'htmlall':'UTF-8'}"{/if} class="{$bodyClass}{if $cookie->isLogged()} logged{/if}{if isset($smarty.get.content_only)} content_only{/if}{if isset($smarty.post.email_create) || isset($smarty.get.create_account)} create{/if} lang{$cookie->id_lang}">
<div id="header">
<div class="content">
<div class="top">
<div class="content">
<span class='help_contact'><a href="{$link->getCMSLink(14)}">{l s='Aide et contact'}</a></span>
{$HOOK_TOP}
</div>
</div>
</div>
{$HOOK_TOP_MENU}
</div>
<div id="subheader"></div>
<div id="columns"> {if !$content_only}
<div class="content"> {if isset($restricted_country_mode) && $restricted_country_mode}
{if isset($SKINSTATIC_COLUMNS)}{$SKINSTATIC_COLUMNS}{/if} <div id="restricted-country">
<p>{l s='You cannot place a new order from your country.'} <span class="bold">{$geolocation_country}</span></p>
</div>
{/if}
<div id="page">
{if in_array($page_name, $displayLeft)} <!-- Header -->
<!-- Left --> <div id="header">
<div id="left_column" class="column"> <div class="content">
{$HOOK_LEFT_COLUMN} <div class="top">
</div> <div class="content">
{/if} <span class='help_contact'><a href="{$link->getCMSLink(14)}">{l s='Aide et contact'}</a></span>
{$HOOK_TOP}
</div>
</div>
</div>
{$HOOK_TOP_MENU}
</div>
<div id="subheader"></div>
<!-- Center --> <div id="columns">
<div id="center_column"> <div class="content">
{/if} {if isset($SKINSTATIC_COLUMNS)}{$SKINSTATIC_COLUMNS}{/if}
{if in_array($page_name, $displayLeft)}
<!-- Left -->
<div id="left_column" class="column">
{$HOOK_LEFT_COLUMN}
</div>
{/if}
<!-- Center -->
<div id="center_column">
{/if}

View File

@ -37,6 +37,16 @@
var msg = "{l s='You must agree to the terms of service before continuing.' js=1}"; var msg = "{l s='You must agree to the terms of service before continuing.' js=1}";
{literal} {literal}
function submitCarrier() {
var cgv = acceptCGV();
if(cgv) {
// carrier = $("input[name='id_carrier']:checked","#form").val();
carrier_name = ""+$("input[name='id_carrier']:checked", "#form").data('name')+"";
onStepComplete(3, carrier_name, null, null);
} else {
return cgv;
}
}
function acceptCGV() function acceptCGV()
{ {
if ($('#cgv').length && !$('input#cgv:checked').length) if ($('#cgv').length && !$('input#cgv:checked').length)
@ -82,7 +92,7 @@
{include file="$tpl_dir./errors.tpl"} {include file="$tpl_dir./errors.tpl"}
<form id="form" action="{$link->getPageLink('order.php', true)}" method="post" onsubmit="return acceptCGV();"> <form id="form" action="{$link->getPageLink('order.php', true)}" method="post" onsubmit="return submitCarrier();return !ga.loaded;">
{else} {else}
<h2>2. {l s='Delivery methods'}</h2> <h2>2. {l s='Delivery methods'}</h2>
<div id="opc_delivery_methods" class="opc-main-block"> <div id="opc_delivery_methods" class="opc-main-block">
@ -128,7 +138,7 @@
{foreach from=$carriers item=carrier name=myLoop} {foreach from=$carriers item=carrier name=myLoop}
<tr class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{/if} {if $smarty.foreach.myLoop.index % 2}alternate_item{else}item{/if}"> <tr class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{/if} {if $smarty.foreach.myLoop.index % 2}alternate_item{else}item{/if}">
<td class="carrier_action radio"> <td class="carrier_action radio">
<input type="radio" name="id_carrier" value="{$carrier.id_carrier|intval}" id="id_carrier{$carrier.id_carrier|intval}" {if $opc}onclick="updateCarrierSelectionAndGift();"{/if} {if !($carrier.is_module AND $opc AND !$isLogged)}{if $carrier.id_carrier == $checked}checked="checked"{/if}{else}disabled="disabled"{/if} /> <input type="radio" name="id_carrier" value="{$carrier.id_carrier|intval}" data-name="{$carrier.name|escape:'htmlall':'UTF-8'}" id="id_carrier{$carrier.id_carrier|intval}" {if $opc}onclick="updateCarrierSelectionAndGift();"{/if} {if !($carrier.is_module AND $opc AND !$isLogged)}{if $carrier.id_carrier == $checked}checked="checked"{/if}{else}disabled="disabled"{/if} />
</td> </td>
<td class="carrier_name"> <td class="carrier_name">
<label for="id_carrier{$carrier.id_carrier|intval}"> <label for="id_carrier{$carrier.id_carrier|intval}">

View File

@ -34,6 +34,25 @@
var txtProduct = "{l s='product'}"; var txtProduct = "{l s='product'}";
var txtProducts = "{l s='products'}"; var txtProducts = "{l s='products'}";
// ]]> // ]]>
function submitPayment(){
$input = $('input[name="paiement-method"]:checked');
if(!$input.length) {
alert(paiementErrorMessage);
}
if ($input.val()) {
// redirect for GA send event
onStepComplete(4, $input.attr('data-module-name') ,$input.val(),null);
} else {
// LOADER POUR PAYPAL
if ($input.attr('data-module-name') == "paypal") {
$('.overlay_bbb').fadeIn();
$('.box_paypal').fadeIn();
}
$form = $input.parent().children('div.hidden').children('form');
// submit form for GA send event
onStepComplete(4, $input.attr('data-module-name'),null,$form);
}
}
</script> </script>
{capture name=path}{l s='Your payment method'}{/capture} {capture name=path}{l s='Your payment method'}{/capture}
@ -72,7 +91,7 @@
{/if} {/if}
<p class="cart_navigation"> <p class="cart_navigation">
<a href="{$link->getPageLink('order.php', true)}?step=2" title="{l s='Previous'}" class="button">{l s='Previous'}</a> <a href="{$link->getPageLink('order.php', true)}?step=2" title="{l s='Previous'}" class="button">{l s='Previous'}</a>
<a class="exclusive submitPayment" title="{l s='Valider ma commande'}" class="button">{l s='Valider ma commande'}</a> <a class="exclusive submitPayment" title="{l s='Valider ma commande'}" class="button" onclick="submitPayment(); return !ga.loaded;">{l s='Valider ma commande'}</a>
</p> </p>
{else} {else}
</div> </div>
@ -93,37 +112,36 @@
</div> </div>
<script> <script>
var paiementErrorMessage = "{l s='You have to choose a paiement method' js=1}"; var paiementErrorMessage = "{l s='You have to choose a paiement method' js=1}";
</script> </script>
{literal} {literal}
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('.payment_module .inner').live('click', function(e) { $('.payment_module .inner').live('click', function(e) {
$(this).children('.input_radio').children('input[name="paiement-method"]').attr('checked', true); $(this).children('.input_radio').children('input[name="paiement-method"]').attr('checked', true);
}); });
$('.submitPayment').live('click', function(e) {
e.preventDefault();
// check if selected
$input = $('input[name="paiement-method"]:checked');
if(!$input.length) {
alert(paiementErrorMessage);
}
if ($input.val()) { // $('.submitPayment').live('click', function(e) {
window.location = $input.val(); // e.preventDefault();
} else { // // check if selected
// LOADER POUR PAYPAL // $input = $('input[name="paiement-method"]:checked');
if ($input.attr('data-module-name') == "paypal") { // if(!$input.length) {
$('.overlay_bbb').fadeIn(); // alert(paiementErrorMessage);
$('.box_paypal').fadeIn(); // }
} // if ($input.val()) {
$form = $input.parent().children('div.hidden').children('form'); // window.location = $input.val();
$form.submit(); // } else {
} // // LOADER POUR PAYPAL
// if ($input.attr('data-module-name') == "paypal") {
// $('.overlay_bbb').fadeIn();
// $('.box_paypal').fadeIn();
// }
// $form = $input.parent().children('div.hidden').children('form');
// $form.submit();
// }
}); // });
}); });
</script> </script>