Merge branch 'ticket-14904-achatexpressmobile'

# Conflicts:
#	themes/site_mobile/css/style.css
#	themes/site_mobile/product-list.tpl
This commit is contained in:
David 2018-01-09 16:21:17 +01:00
commit 371ad472aa
18 changed files with 1267 additions and 45 deletions

1
.gitignore vendored
View File

@ -121,3 +121,4 @@ modules/labelgenerate/img/*
modules/purchaseguide/img/*
!modules/purchaseguide/img/index.php
/.user.ini

View File

@ -650,11 +650,13 @@ function confirmation(idProduct, idCombination, quantity, json) {
// AJOUT PANIER PAGE PRODUIT
if($('#quantity_sel').length > 0){
$('#quantity_sel').html(quantity);
var price = $('#our_price_display').html();
price = price.replace(' €','');
var price_float = price.replace(",", ".");
var new_price = parseFloat(price_float) * quantity;
$('#price_add_to_cart').html(String(new_price.toFixed(2)).replace('.',','));
if($('#our_price_display').size() > 0){
var price = $('#our_price_display').html();
price = price.replace(' €','');
var price_float = price.replace(",", ".");
var new_price = parseFloat(price_float) * quantity;
$('#price_add_to_cart').html(String(new_price.toFixed(2)).replace('.',','));
}
$('.overlay_bbb').fadeIn();
$('.box_add_to_cart').fadeIn();
// send add product to cart information to GA

View File

@ -40,16 +40,8 @@ function showExpressCart(event) {
}
function initButtons() {
$('.button.ajax_add_to_cart_button.exclusive:visible').hide().after("{/literal}<a title=\"{l s='Express cart' mod='expresscart'}\" onclick=\"showExpressCart(event); return false;\" class=\"button expresscart\">{l s='Express cart' mod='expresscart'}</a><div class=\"expresscart_frame\"><p class=\"loading\"><img src=\"{$img_dir|replace:'"':'"'}ajax-loader.gif\" alt=\"\" /></p></div>{literal}");
// if(!$.browser.msie || $.browser.msie && $.browser.version.slice(0, 1) > 8) {
// $('.button.ajax_add_to_cart_button.exclusive:visible').hide().after("{/literal}<a title=\"{l s='Express cart' mod='expresscart'}\" onclick=\"showExpressCart(event); return false;\" class=\"button expresscart\">{l s='Express cart' mod='expresscart'}</a><div class=\"expresscart_frame\"><p class=\"loading\"><img src=\"{$img_dir|replace:'"':'"'}ajax-loader.gif\" alt=\"\" /></p></div>{literal}");
// } else {
// $('.button.ajax_add_to_cart_button.exclusive:visible').hide().after($("{/literal}<a title=\"{l s='Express cart' mod='expresscart'}\" class=\"button expresscart\">{l s='Express cart' mod='expresscart'}</a><div class=\"expresscart_frame\"><p class=\"loading\"><img src=\"{$img_dir|replace:'"':'"'}ajax-loader.gif\" alt=\"\" /></p></div>{literal}").click(function(event) {
// showExpressCart(event);
// return false;
// }));
// }
$('.button.ajax_add_to_cart_button.exclusive:visible').hide()
.after("{/literal}<a title=\"{l s='Express cart' mod='expresscart'}\" onclick=\"showExpressCart(event); return false;\" class=\"button expresscart\">{l s='Express cart' mod='expresscart'}</a><div style=\"display:none;\" class=\"expresscart_frame\"><p class=\"loading\"><img src=\"{$img_dir|replace:'"':'"'}ajax-loader.gif\" alt=\"\" /></p></div>{literal}");
}
$(document).ready(function() {

View File

@ -121,8 +121,7 @@
</div>
{/if}
<div class="express_buy" onclick="window.location.href='{$product.link|escape:'htmlall':'UTF-8'}';">
</div>
<div class="express_buy" onclick="window.location.href='{$product.link|escape:'htmlall':'UTF-8'}';"></div>
<div class="button">
{if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}
<span class="on_sale">{l s='On sale!'}</span>

View File

@ -1670,8 +1670,8 @@ body#category .sale_title, body#product .sale_title {
padding: 10px 0px;
border-top: 1px solid #e4e4e4;
border-bottom: 1px solid #e4e4e4;
padding: 10px 0px;
text-align: left;
clear:both;
}
body#category .sale_title .gradient,
body#product .sale_title .gradient {
@ -1679,7 +1679,7 @@ body#category .sale_title, body#product .sale_title {
display: inline-block;
height: 40px;
width: 15%;
vertical-align: middle;
vertical-align: top;
border: 0;
}
body#category .sale_title .gradient a.back,
@ -3818,7 +3818,7 @@ h2.title{
margin-bottom: 10px;
font-size: 18px;
font-weight: normal;
padding: 10px;
/* padding: 10px;*/
text-align: center;
clear:both;
/* -webkit-box-shadow: 0 5px 3px -3px #ccc;

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 983 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@ -522,6 +522,13 @@ $_LANG['prices-drop_c8f312df214e2295809027c6ca79d232'] = 'Promotions';
$_LANG['prices-drop_62e15ca272c14c03aa52b64c8caf2334'] = 'Aucune promotion.';
$_LANG['product-add_to_cart_0eaadb4fcb48a0a0ed7bc9868be9fbaa'] = 'Attention';
$_LANG['product-add_to_cart_7834264c399120ba7296ae282f46c605'] = 'Les articles de cette vente seront expédiés selon le délai spécifique indiqué sur la fiche produit. Vous pouvez combiner ces articles avec des ventes du même délais.';
$_LANG['product-add_to_cart_e98019105dd9444b6d80e3e788289a79'] = 'Ce produit a bien été ajouté au panier';
$_LANG['product-add_to_cart_3075148ed2cb5479e9e9c1cfd8fd8be0'] = 'Fermer la fenètre';
$_LANG['product-add_to_cart_1b27b371c9e7d0298eab533bffae53b7'] = 'Quantité';
$_LANG['product-add_to_cart_7255b165f0be9f2380465cd98f9f1e41'] = 'Toutes les ventes';
$_LANG['product-add_to_cart_9056510ed1245d5000afd43cf2816902'] = 'Voir mon panier';
$_LANG['product-add_to_cart_f507368685bf131d9a5940b2e24f2602'] = 'Commandez dans plusieurs ventes au sein du même panier et profitez de frais de port uniques';
$_LANG['product-add_to_cart_5af6614a8af23ed2fdba3b0f47b40128'] = 'Nos meilleures ventes';
$_LANG['product-compare_97f014aa339f5b37951f100fb1a086d8'] = 'Merci de choisir au moins 1 produit.';
$_LANG['product-compare_fe22c6b5957bca5380f9cf6529fea8c5'] = 'Vous ne pouvez pas ajouter plus de';
$_LANG['product-compare_1a3addc6c8dccf79752c39ca4a3b6423'] = 'produits dans le comparateur.';

View File

@ -37,29 +37,6 @@ var customizationIdMessage = '{l s='Customization #' mod='blockcartex' js=1}';
var removingLinkText = '{l s='remove this product from my cart' mod='blockcartex' js=1}';
</script>
{/if}
<script type="text/javascript">{literal}
<!--
$(document).ready(function() {
var cart_hide = function(event){
if($("#cart_block #cart_block_list").has($(event.target)).length == 0) {
event.stopPropagation();
event.data.m.removeClass('active');
$("#cart_block #cart_block_list").hide();
$("html, #header_user li.last > a").unbind("click", cart_hide);
}
}
/*
$("#cart_block #cart_block_summary").click(function(event){
event.stopPropagation();
var m = $(this);
m.toggleClass('active');
$("#cart_block #cart_block_list").toggle();
$("html, #header_user li.last > a").bind("click", {m: m}, cart_hide);
});
*/
});
-->
{/literal}</script>
<!-- MODULE Block cart -->
<div id="cart_block" class="block exclusive">
@ -170,5 +147,4 @@ $(document).ready(function() {
</div>
</div>
<!-- /MODULE Block cart -->
{/if}

View File

@ -19,3 +19,18 @@ $_MODULE['<{blockcartex}site_mobile>blockcart_96b0141273eabab320119c467cdcaf17']
$_MODULE['<{blockcartex}site_mobile>blockcart_0d11c2b75cf03522c8d97938490466b2'] = 'Les prix sont TTC';
$_MODULE['<{blockcartex}site_mobile>blockcart_41202aa6b8cf7ae885644717dab1e8b4'] = 'Les prix sont HT';
$_MODULE['<{blockcartex}site_mobile>blockcart_377e99e7404b414341a9621f7fb3f906'] = 'Commander';
$_MODULE['<{blockcartex}site_mobile>ajax_cart_e98019105dd9444b6d80e3e788289a79'] = 'Artículo añadido correctamente a tu cesta';
$_MODULE['<{blockcartex}site_mobile>ajax_cart_7d206237f9912ea010005db2c20b60ce'] = 'Cerrar ventana';
$_MODULE['<{blockcartex}site_mobile>ajax_cart_1b27b371c9e7d0298eab533bffae53b7'] = 'Cantidad';
$_MODULE['<{blockcartex}site_mobile>ajax_cart_f01390a0b796aab97beed915df1cdd63'] = 'IVA';
$_MODULE['<{blockcartex}site_mobile>ajax_cart_7255b165f0be9f2380465cd98f9f1e41'] = 'Todas las ventas';
$_MODULE['<{blockcartex}site_mobile>ajax_cart_9056510ed1245d5000afd43cf2816902'] = 'Ver cesta';
$_MODULE['<{blockcartex}site_mobile>ajax_cart_f507368685bf131d9a5940b2e24f2602'] = 'Recuerda que puedes añadir a tu cesta productos de las diferentes ventas y realizar así un pedido único, para pagar los gastos de envío solamente una vez';
$_MODULE['<{blockcartex}site_mobile>ajax_cart_2068523466dee7c610a524ccbd4cd156'] = 'Te enviaremos los artículos de esta venta en el plazo entregado en la ficha del producto. Puedes agrupar productos de otras ventas siempre y cuando tengan el mismo plazo de entrega. Los recibirás antes de Navidad.';
$_MODULE['<{blockcartex}site_mobile>ajax_cart_1ed11cdf4edfa7c0f2e379cee803eee9'] = 'Te enviaremos los artículos de esta venta en el plazo entregado en la ficha del producto. Puedes agrupar productos de otras ventas siempre y cuando tengan el mismo plazo de entrega. Te los enviaremos en 48h';
$_MODULE['<{blockcartex}site_mobile>ajax_cart_7834264c399120ba7296ae282f46c605'] = 'Te enviaremos los artículos de esta venta en el tiempo previsto indicado en la ficha del producto. Lo sentimos, no puedes añadir productos de otras ventas distintas a este pedido. Para continuar, valida tu pedido actual o vacía tu cesta.';
$_MODULE['<{blockcartex}site_mobile>ajax_cart_5af6614a8af23ed2fdba3b0f47b40128'] = 'Nuestras mejores ventas';
$_MODULE['<{blockcartex}site_mobile>ajax_cart_0eaadb4fcb48a0a0ed7bc9868be9fbaa'] = 'Advertencia';
$_MODULE['<{blockcartex}site_mobile>ajax_cart_7fdd0ff9b7b9cb8735565654b631227d'] = 'Validar mi cesta';
$_MODULE['<{blockcartex}site_mobile>ajax_cart_0bce44f51ebf91d4a94619eb2e060186'] = 'Vaciar mi cesta';
$_MODULE['<{blockcartex}site_mobile>ajax_cart_043183b82e48d113613be352cb951798'] = 'Volver a la página de inicio';

View File

@ -19,3 +19,8 @@ $_MODULE['<{blockcartex}site_mobile>blockcart_96b0141273eabab320119c467cdcaf17']
$_MODULE['<{blockcartex}site_mobile>blockcart_0d11c2b75cf03522c8d97938490466b2'] = 'Les prix sont TTC';
$_MODULE['<{blockcartex}site_mobile>blockcart_41202aa6b8cf7ae885644717dab1e8b4'] = 'Les prix sont HT';
$_MODULE['<{blockcartex}site_mobile>blockcart_377e99e7404b414341a9621f7fb3f906'] = 'Commander';
$_MODULE['<{blockcartex}site_mobile>ajax_cart_f507368685bf131d9a5940b2e24f2602'] = 'Commandez dans plusieurs ventes au sein du même panier et profitez de frais de port uniques';
$_MODULE['<{blockcartex}site_mobile>ajax_cart_2068523466dee7c610a524ccbd4cd156'] = 'Les articles de cette vente seront expédiés selon le délai spécifique indiqué sur la fiche produit. Vous pouvez combiner ces articles avec des ventes du même délais.';
$_MODULE['<{blockcartex}site_mobile>ajax_cart_1ed11cdf4edfa7c0f2e379cee803eee9'] = 'Les articles de cette vente seront expédiés selon le délai spécifique indiqué sur la fiche produit. Vous pouvez combiner ces articles avec des ventes du même délais pour une expédition sous 48h.';
$_MODULE['<{blockcartex}site_mobile>ajax_cart_7834264c399120ba7296ae282f46c605'] = 'Les articles de cette vente seront expédiés selon le délai spécifique indiqué sur la fiche produit. Vous navez donc pas la possibilité dajouter des produits dautres ventes. Pour continuer, veuillez valider votre commande ou vider votre panier.';
$_MODULE['<{blockcartex}site_mobile>ajax_cart_0eaadb4fcb48a0a0ed7bc9868be9fbaa'] = 'Attention';

View File

@ -13,7 +13,7 @@ $(document).ready(function() {
if(loaded.error == false) {
endreached = loaded.endreached;
$("#product_list").append(loaded.products);
$("#product_list").val(parseInt($("#product_list").val()) + 1);
$("#product_list").val(parseInt($("#product_list").val()) + 1);
} else {
error = true;
var error_i18n = {

View File

@ -30,6 +30,23 @@
{/if}
{/if}
{/if}
<div style="float:right; width:40%;">
{if isset($product.quantity_all_versions)}
{if $product.quantity_all_versions <= 0 && $product.quantity <= 0}
{else}
<a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart.php')}?add&amp;id_product={$product.id_product|intval}{if isset($static_token)}&amp;token={$static_token}{/if}" title="{l s='Express buy'}">
</a>
{/if}
{else}
{if $product.quantity <= 0}
{else}
<a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart.php')}?add&amp;id_product={$product.id_product|intval}{if isset($static_token)}&amp;token={$static_token}{/if}" title="{l s='Express buy'}">
</a>
{/if}
{/if}
</div>
{* <span class="gradient">
<a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|truncate:360:'...'|strip_tags:'UTF-8'|escape:'htmlall':'UTF-8'}">
<img src="{$img_dir}arrow-blank.png" alt="{$product.description_short|truncate:360:'...'|strip_tags:'UTF-8'|escape:'htmlall':'UTF-8'}" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

View File

@ -0,0 +1,59 @@
<script type="text/javascript">{literal}
function hideExpressCart(event){
if($(".button.expresscart.active").parent().parent().has($(event.target)).length == 0 || $(".button.expresscart.active") == $(event.target)) {
event.data.m.removeClass('active');
$(".expresscart_frame").hide();
$("html").unbind("click", hideExpressCart);
$('a.button').css('opacity', 1);
$('.close_popup').remove();
}
return false;
}
function showExpressCart(event) {
var m = $(event.target);
m.toggleClass('active');
if ($('.box_add_to_cart').length > 0) {
$('.box_add_to_cart').remove();
$('.close_popup').remove();
}
var id_product = m.parent().children(".button.ajax_add_to_cart_button").attr("rel").split("_")[3];
$.ajax({
type: 'POST',
url: baseDir + 'modules/expresscart/ajax.php',
async: true,
cache: false,
dataType : "html",
data: 'id_product=' + id_product,
success: function(jsonData) {
$('.overlay_bbb').parent()
.append('<div class="box_add_to_cart"><div class="content"></div></div>')
.append('<a href="#" class="close_popup"></a>');
$('.box_add_to_cart .content').html(jsonData);
$('.overlay_bbb').fadeIn();
$('.box_add_to_cart').fadeIn();
},
error: function() {alert('ERROR: unable to display');}
});
return false;
}
function initButtons() {
$('.button.ajax_add_to_cart_button.exclusive').hide()
.after("{/literal}<a title=\"{l s='Express cart' mod='expresscart'}\" onclick=\"showExpressCart(event); return false;\" class=\"button expresscart\"></a><div style=\"display:none;\" class=\"expresscart_frame\"><p class=\"loading\"><img src=\"{$img_dir|replace:'"':'"'}ajax-loader.gif\" alt=\"\" /></p></div>{literal}");
}
$(document).ready(function() {
initButtons();
$("#product_list").bind("updated", function() {
initButtons();
return false;
});
});
{/literal}</script>

View File

@ -0,0 +1,488 @@
<script type="text/javascript">
var baseDir = "{$base_dir_ssl}";
var static_token = "{$static_token}";
var token = '{$token}';
var priceDisplayPrecision = {$priceDisplayPrecision};
var priceDisplayMethod = {$priceDisplay};
var roundMode = {$roundMode};
var isoLang = "{$lang_iso}";
var product_frame = true;
</script>
<script type="text/javascript" src="{$base_dir_ssl}js/scripts.js"></script>
<script type="text/javascript" src="{$js_dir}tools.js"></script>
<script type="text/javascript" src="{$js_dir}product.js?v=2"></script>
{if $cartex}
<script type="text/javascript" src="{$base_dir_ssl}modules/blockcartex/ajax-cart.js?v=4"></script>
{else}
<script type="text/javascript" src="{$base_dir_ssl}modules/blockcartex/ajax-cart.js?v=4"></script>
{/if}
<style type="text/css">{literal}
h1 {
text-align: left;
padding:0;
line-height: 20px;
text-shadow:0px 0px 0px transparent;
font-family: 'Montserrat-Regular';
font-size:12px;
font-weight:normal;
font-style: normal;
color:#333;
}
p {
margin: 0px;
padding: 0 15px 10px;
}
.center_element {
margin : 20px 0;
padding : 5px 5px 5px 5px;
/*width : 220px;*/
/*background : #DEA4BE;*/
background : #fb66a9;
float : left;
}
.center_element img {
border : 5px solid #FFFFFF;
float : left;
}
.right_element {
float : left;
width: 148px;
}
#quantity_wanted_p {
}
#quantity_wanted {
text-align: right;
}
input[type="text"] {
height: 24px;
font-size: 12px;
color: #8B8B8B;
padding: 4px;
border : none;
border-radius : 2px;
-webkit-border-radius : 2px;
-moz-border-radius : 2px;
-o-border-radius : 2px;
-ms-border-radius : 2px;
}
select {
height: 24px;
font-size: 12px;
color: #8B8B8B;
padding: 4px;
background : #FFFFFF;
width : 100%;
border : none;
border-radius : 2px;
-webkit-border-radius : 2px;
-moz-border-radius : 2px;
-o-border-radius : 2px;
-ms-border-radius : 2px;
text-indent: 0;
}
select option {
font-size: 12px;
color: #666666;
border: 0px;
}
label {
font-size : 14px;
color : #FFFFFF;
display: block;
margin-bottom: 8px;
}
.border-separator {
border-top : 1px solid #000;
height : 0px;
margin : 1px 0;
}
.hidden {
display: none;
}
#prices_display {
margin: 0px;
padding-top: 20px;
}
#reduction {
font-weight: normal;
}
p.price, p#old_price {
font-size: 13px;
padding: 0;
height: 17px;
color : #333333;
clear: both;
float : left;
margin-bottom : 10px;
}
p.price span, p#old_price span {
float: left;
margin-right:5px;
font-style: italic;
font-family: Georgia, Times, "Times New Roman", serif;
}
p#old_price span.bold {
color: #514C8C;
float : left;
text-decoration: line-through;
}
p#old_price span#old_price_display {
text-decoration: line-through;
}
p.price .our_price_display {
color: #fb66a9;
font-weight: bold;
font-style: normal;
}
#availability_statut {
text-align: center;
margin: 0px;
padding: 0px;
}
#add_to_cart input {
background : url('./themes/site_mobile/modules/expresscart/arrow.png') no-repeat right 9px #514C8C;
height: 30px;
font-family: Georgia, Times, "Times New Roman", serif;
font-size: 13px;
font-style: italic;
color: #ffffff;
margin: 10px 0 0;
padding: 7px 30px 6px 20px;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
text-decoration: none;
border : none;
cursor : pointer;
/*float : right;*/
}
#add_to_cart {
cursor : pointer;
padding-right : 0;
margin-left: 30%;
}
#jqibox {
background-image : -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgb(204, 204, 204)), to(rgb(255, 255, 255)));
background-image : -moz-linear-gradient(34% 100% 90deg,#FFFFFF, #CCCCCC);
background-image : linear-gradient(34% 100% 90deg,#FFFFFF, #CCCCCC);
width : 100%;
height : 100%;
padding: 0px;
margin: 0px;
left: 0px;
top: 0px;
}
#jqibox #jqi {
margin-left : -124px !important;
width: 250px !important;
height: 430px !important;
}
.jqiclose {
display: none;
}
.jqimessage {
width : 100%;
text-align: center;
line-height: 1.4em;
position : relative;
}
.jqimessage div {
border : 1px solid #FFFFFF;
border-color : #FFFFFF transparent;
padding : 20px 0;
}
.jqimessage div:before {
height : 1px;
width : 100%;
border-top : 1px solid #FFFFFF;
content : "";
position : absolute;
top : 50px;
padding : 0;
margin : 0;
left : 0;
}
.jqimessage div:after {
height : 1px;
width : 100%;
border-top : 1px solid #FFFFFF;
content : "";
position : absolute;
bottom : -3px;
padding : 0;
margin : 0;
left : 0;
}
.jqimessage p {
background : #DEA3BD;
font-size : 18px;
padding : 40px 20px;
width : 210px;
color : #FFFFFF;
line-height: 1.4em;
}
.jqimessage h1 {
margin-top: 21px;
}
.jqibuttons {
text-align: center;
}
.jqibuttons button {
background : #514C8C;
height: 30px;
font-family: Georgia, Times, "Times New Roman", serif;
font-size: 13px;
font-style: italic;
color: #ffffff;
margin: 0;
display : block;
padding: 7px 20px 6px 20px;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
text-decoration: none;
border : none;
margin : 30px auto 0;
cursor : pointer;
float : right;
}
.jqibuttons button.jqidefaultbutton {
background : #E26EA2;
height: 30px;
font-family: Georgia, Times, "Times New Roman", serif;
font-size: 13px;
font-style: italic;
color: #ffffff;
margin: 0;
display : block;
padding: 7px 20px 6px 20px;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
text-decoration: none;
border : none;
margin : 30px auto 0;
cursor : pointer;
float : left;
}
div.product_box .desc p.name {
margin: 0;
padding: 0;
}
div.product_box p.quantity {
padding: 0;
margin-bottom: 5px;
}
/*.close_popup {
position: absolute;
right: 60px;
top: 50px;
font-style: normal;
font-size: 20px;
color: #FFFFFF;
background: url('../themes/site_mobile/img/cross.png') no-repeat;
width: 24px;
height: 24px;
z-index: 1000;
vertical-align: middle;
text-align: center;
}*/
{/literal}</style>
<script type="text/javascript">
// <![CDATA[
// PrestaShop internal settings
var currencySign = '{$currencySign|html_entity_decode:2:"UTF-8"}';
var currencyRate = '{$currencyRate|floatval}';
var currencyFormat = '{$currencyFormat|intval}';
var currencyBlank = '{$currencyBlank|intval}';
var taxRate = {$tax_rate|floatval};
//JS Hook
var oosHookJsCodeFunctions = new Array();
// Parameters
var id_product = '{$product->id|intval}';
var productHasAttributes = {if isset($groups)}true{else}false{/if};
var quantitiesDisplayAllowed = {if $display_qties == 1}true{else}false{/if};
var quantityAvailable = {if $display_qties == 1 && $product->quantity}{$product->quantity}{else}0{/if};
var allowBuyWhenOutOfStock = {if $allow_oosp == 1}true{else}false{/if};
var availableNowValue = '{$product->available_now|escape:'quotes':'UTF-8'}';
var availableLaterValue = '{$product->available_later|escape:'quotes':'UTF-8'}';
var productPriceTaxExcluded = {$product->getPriceWithoutReduct(true)|default:'null'} - {$product->ecotax};
var reduction_percent = {if $product->specificPrice AND $product->specificPrice.reduction AND $product->specificPrice.reduction_type == 'percentage'}{$product->specificPrice.reduction*100}{else}0{/if};
var reduction_price = {if $product->specificPrice AND $product->specificPrice.reduction AND $product->specificPrice.reduction_type == 'amount'}{$product->specificPrice.reduction}{else}0{/if};
var specific_price = {if $product->specificPrice AND $product->specificPrice.price}{$product->specificPrice.price}{else}0{/if};
var specific_currency = {if $product->specificPrice AND $product->specificPrice.id_currency}true{else}false{/if};
var group_reduction = '{$group_reduction}';
var default_eco_tax = {$product->ecotax};
var ecotaxTax_rate = {$ecotaxTax_rate};
var currentDate = '{$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'}';
var maxQuantityToAllowDisplayOfLastQuantityMessage = {$last_qties};
var noTaxForThisProduct = {if $no_tax == 1}true{else}false{/if};
var displayPrice = {$priceDisplay};
var productReference = '{$product->reference|escape:'htmlall':'UTF-8'}';
var productAvailableForOrder = {if (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE}'0'{else}'{$product->available_for_order}'{/if};
var productShowPrice = '{if !$PS_CATALOG_MODE}{$product->show_price}{else}0{/if}';
var productUnitPriceRatio = '{$product->unit_price_ratio}';
var idDefaultImage = {if isset($cover.id_image_only)}{$cover.id_image_only}{else}0{/if};
// Customizable field
var img_ps_dir = '{$img_ps_dir}';
var customizationFields = new Array();
{assign var='imgIndex' value=0}
{assign var='textFieldIndex' value=0}
{foreach from=$customizationFields item='field' name='customizationFields'}
{assign var="key" value="pictures_`$product->id`_`$field.id_customization_field`"}
customizationFields[{$smarty.foreach.customizationFields.index|intval}] = new Array();
customizationFields[{$smarty.foreach.customizationFields.index|intval}][0] = '{if $field.type|intval == 0}img{$imgIndex++}{else}textField{$textFieldIndex++}{/if}';
customizationFields[{$smarty.foreach.customizationFields.index|intval}][1] = {if $field.type|intval == 0 && isset($pictures.$key) && $pictures.$key}2{else}{$field.required|intval}{/if};
{/foreach}
// Images
var img_prod_dir = '{$img_prod_dir}';
var combinationImages = new Array();
{if isset($combinationImages)}
{foreach from=$combinationImages item='combination' key='combinationId' name='f_combinationImages'}
combinationImages[{$combinationId}] = new Array();
{foreach from=$combination item='image' name='f_combinationImage'}
combinationImages[{$combinationId}][{$smarty.foreach.f_combinationImage.index}] = {$image.id_image|intval};
{/foreach}
{/foreach}
{/if}
combinationImages[0] = new Array();
{if isset($images)}
{foreach from=$images item='image' name='f_defaultImages'}
combinationImages[0][{$smarty.foreach.f_defaultImages.index}] = {$image.id_image};
{/foreach}
{/if}
// Translations
var doesntExist = '{l s='The product does not exist in this model. Please choose another.' mod='expresscart' js=1}';
var doesntExistNoMore = '{l s='This product is no longer in stock' mod='expresscart' js=1}';
var doesntExistNoMoreBut = '{l s='with those attributes but is available with others' mod='expresscart' js=1}';
var uploading_in_progress = '{l s='Uploading in progress, please wait...' mod='expresscart' js=1}';
var fieldRequired = '{l s='Please fill in all required fields, then save the customization.' mod='expresscart' js=1}';
var quantityAvailableSentence = '{l s='Warning: X items in stock!' mod='expresscart' js=1}';
var oneQuantityAvailableSentence = '{l s='Warning: 1 item in stock!' mod='expresscart' js=1}';
{if isset($groups)}
// Combinations
{foreach from=$combinations key=idCombination item=combination}
addCombination({$idCombination|intval}, new Array({$combination.list}), {$combination.quantity}, {$combination.price}, {$combination.ecotax}, {$combination.id_image}, '{$combination.reference|addslashes}', {$combination.unit_impact}, {$combination.minimal_quantity});
{/foreach}
// Colors
{if $colors|@count > 0}
{if $product->id_color_default}var id_color_default = {$product->id_color_default|intval};{/if}
{/if}
{/if}
{literal}
$(".jqidefaultbutton").click(function(){
alert("ok");
});
{/literal}
{literal}
$(function() {
$('p#add_to_cart input').unbind('click').click(function(){
ajaxCart.add( $('#product_page_product_id').val(), $('#idCombination').val(), true, null, $('#quantity_wanted').val(), null);
return false;
});
});
{/literal}
//]]>
</script>
{if isset($colors) && $colors}
<!-- colors -->
<div id="color_picker">
<p>{l s='Pick a color:' mod='expresscart' js=1}</p>
<div class="clear"></div>
<ul id="color_to_pick_list">
{foreach from=$colors key='id_attribute' item='color'}
<li><a id="color_{$id_attribute|intval}" class="color_pick" style="background: {$color.value};" onclick="updateColorSelect({$id_attribute|intval});$('#wrapResetImages').show('slow');" title="{$color.name}">{if file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')}<img src="{$img_col_dir}{$id_attribute}.jpg" alt="{$color.name}" width="20" height="20" />{/if}</a></li>
{/foreach}
</ul>
<div class="clear"></div>
</div>
{/if}
{if ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)}
<!-- add to cart form-->
<form id="buy_block" {if $PS_CATALOG_MODE AND !isset($groups) AND $product->quantity > 0}class="hidden"{/if} action="{$link->getPageLink('cart.php')}" method="post">
<!-- hidden datas -->
<p class="hidden">
<input type="hidden" name="token" value="{$static_token}" />
<input type="hidden" name="id_product" value="{$product->id|intval}" id="product_page_product_id" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="id_product_attribute" id="idCombination" value="" />
</p>
<h1>{$product->name}</h1>
<div class="border-separator"></div>
<div class="center_element">
{assign var=id_image value=Product::getCover($product->id)}
<img src="{$link->getImageLink($product->link_rewrite, $product->id|cat:'-'|cat:$id_image.id_image, 'small')}" alt="{$product->name|escape:'htmlall':'UTF-8'}" />
<div class="right_element">
{if $product->quantity > 0}
{if isset($groups)}
<!-- attributes -->
<div id="attributes">
{foreach from=$groups key=id_attribute_group item=group}
{if $group.attributes|@count}
<p>
<label for="group_{$id_attribute_group|intval}">{$group.name|escape:'htmlall':'UTF-8'} :</label>
{assign var="groupName" value="group_$id_attribute_group"}
<select name="{$groupName}" id="group_{$id_attribute_group|intval}" onchange="javascript:findCombination();{if $colors|@count > 0}$('#wrapResetImages').show('slow');{/if};">
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if} title="{$group_attribute|escape:'htmlall':'UTF-8'}">{$group_attribute|escape:'htmlall':'UTF-8'}</option>
{/foreach}
</select>
</p>
{/if}
{/foreach}
</div>
{/if}
<!-- quantity wanted -->
<p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
<label>{l s='Quantity :' mod='expresscart'}</label>
<input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} />
</p>
<!-- minimal quantity wanted -->
<p id="minimal_quantity_wanted_p"{if $product->minimal_quantity <= 1 OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>{l s='You must add ' mod='expresscart'} <b id="minimal_quantity_label">{$product->minimal_quantity}</b> {l s=' as a minimum quantity to buy this product.' mod='expresscart'}</p>
{if $product->minimal_quantity > 1}
<script type="text/javascript">
checkMinimalQuantity();
</script>
{/if}
{/if}
</div>
</div>
<div style="clear: both;"></div>
<div class="border-separator"></div>
{if $product->quantity > 0}
<p id="add_to_cart" class="button">
<input type="submit" name="Submit" value="{l s='Add to cart' mod='expresscart'}" class="exclusive" />
</p>
{/if}
<p id="availability_statut"{if ($product->quantity <= 0 && !$product->available_later && $allow_oosp) OR ($product->quantity > 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
<span id="availability_value"{if $product->quantity <= 0} class="warning_inline"{/if}>
{if $product->quantity <= 0}{if $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock' mod='expresscart'}{/if}{else}{$product->available_now}{/if}
</span>
</p>
</form>
{/if}

View File

@ -0,0 +1,661 @@
<!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">
<head>
<title></title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<meta name="robots" content="noindex,nofollow" />
<script type="text/javascript">
var baseDir = "{$base_dir_ssl}";
var static_token = "{$static_token}";
var token = '{$token}';
var priceDisplayPrecision = {$priceDisplayPrecision};
var priceDisplayMethod = {$priceDisplay};
var roundMode = {$roundMode};
var isoLang = "{$lang_iso}";
var product_frame = true;
</script>
<script type="text/javascript" src="{$base_dir_ssl}js/scripts.js"></script>
<script type="text/javascript" src="{$js_dir}tools.js"></script>
<script type="text/javascript" src="{$js_dir}product.js?v=2"></script>
{if $cartex}
<script type="text/javascript" src="{$base_dir_ssl}modules/blockcartex/ajax-cart.js?v=4"></script>
{else}
<script type="text/javascript" src="{$base_dir_ssl}modules/blockcartex/ajax-cart.js?v=4"></script>
{/if}
<style type="text/css">{literal}
html {
margin: 0px;
padding: 0px;
height: 100%;
width: 100%;
}
body {
background: rgb(238,238,238); /* Old browsers */
background: -moz-linear-gradient(left, rgba(238,238,238,1) 0%, rgba(238,238,238,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(238,238,238,1)), color-stop(100%,rgba(238,238,238,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, rgba(238,238,238,1) 0%,rgba(238,238,238,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, rgba(238,238,238,1) 0%,rgba(238,238,238,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, rgba(238,238,238,1) 0%,rgba(238,238,238,1) 100%); /* IE10+ */
background: linear-gradient(to right, rgba(238,238,238,1) 0%,rgba(238,238,238,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#eeeeee',GradientType=1 ); /* IE6-9 */
margin: 0px;
padding: 0px;
color: #666666;
font-size: 12px;
font-family: tahoma,arial,sans-serif;
height: 100%;
width: 100%;
overflow: hidden;
position: absolute;
top: 0px;
left: 0px;
}
h1 {
text-align: center;
line-height: 1em;
width: 500px;
color: #1E1633;
font-style: italic;
font-family: Georgia, Times, "Times New Roman", serif;
font-weight: normal;
/* min-height: 2em; */
font-size: 16px;
margin: 5px 0px;
}
p {
margin: 0px;
padding: 0 15px 10px;
}
.center_element {
margin : 10px 0;
padding : 10px ;
width : 320px;
/*background : #DEA4BE;*/
background : #fb66a9;
float : left;
box-sizing: border-box;
height: 133px;
}
.center_element img {
border : 5px solid #FFFFFF;
float : left;
}
.right_element {
float : left;
width: 220px;
}
#attributes{
width: 150px;
float: left;
}
#quantity_wanted_p {
padding:0;
}
#quantity_wanted {
text-align: right;
}
.quantity_wanted{
float: right;
width: 65px;
}
#availability_value{
font-size: 10px;
font-weight: 700;
width: 100%;
}
input[type="text"] {
font-size: 12px;
color: #8B8B8B;
padding: 4px;
border : none;
border-radius : 2px;
-webkit-border-radius : 2px;
-moz-border-radius : 2px;
-o-border-radius : 2px;
-ms-border-radius : 2px;
}
select {
font-size: 12px;
color: #8B8B8B;
padding: 4px;
background : #FFFFFF;
width : 100%;
border : none;
border-radius : 2px;
-webkit-border-radius : 2px;
-moz-border-radius : 2px;
-o-border-radius : 2px;
-ms-border-radius : 2px;
}
select option {
font-size: 12px;
color: #666666;
border: 0px;
}
label {
font-size : 14px;
color : #FFFFFF;
display: block;
margin-bottom: 8px;
}
form {
height: 200px;
width: 500px;
margin: 0px;
}
.border-separator {
border-top : 1px solid #FFFFFF;
height : 0px;
margin : 1px 0;
}
.hidden {
display: none;
}
#buy_block_footer {
margin : 10px auto 0;
}
#prices_display {
padding-top: 10px;
float: right;
width: 150px;
height: 145px;
position: relative;
}
#reduction {
font-weight: bold;
}
div.price, p#old_price {
font-size: 13px;
padding: 0;
color: #333;
clear: both;
margin-bottom: 5px;
}
div.price span, p#old_price span {
font-style: italic;
font-family: Georgia, Times, "Times New Roman", serif;
}
p#old_price span {
margin-right:5px;
}
p#old_price span.bold {
color: #514C8C;
}
p#old_price span.reduction{
color: #4F4E9A;
}
p#old_price span#old_price_display {
text-decoration: line-through;
}
div.price p{
width: 100%;
text-align: center;
padding: 0;
}
div.price p.our_price_display span {
font-weight: bold;
font-style: italic;
color: #FB69AA;
font-size: 16px;
}
p.price-ecotax{
text-align: center;
font-size: 9px;
}
#availability_statut {
text-align: center;
margin: 0px;
padding: 0px;
}
#add_to_cart_product_footer input {
background : url('arrow.png') no-repeat right 9px #514C8C;
height: 30px;
font-family: Georgia, Times, "Times New Roman", serif;
font-size: 13px;
font-style: italic;
color: #ffffff;
margin: 20px 0 0;
padding: 7px 30px 6px 20px;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
text-decoration: none;
border : none;
cursor : pointer;
display: inline-block;
}
#add_to_cart_product_footer {
cursor: pointer;
padding: 0;
text-align: center;
position: absolute;
bottom: 12px;
left: 0;
right: 0;
}
.product_added_to_cart {
display: none;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.7);
box-sizing: border-box;
text-align: center;
position: absolute;
z-index: 999;
padding: 85px 20px;
}
.product_added_to_cart p{
color: #fff;
font-family: "georgia";
font-style: italic;
font-weight: bold;
font-size: 18px;
}
#jqibox {
background-image : -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgb(204, 204, 204)), to(rgb(255, 255, 255)));
background-image : -moz-linear-gradient(34% 100% 90deg,#FFFFFF, #CCCCCC);
background-image : linear-gradient(34% 100% 90deg,#FFFFFF, #CCCCCC);
width : 100%;
height : 100%;
padding: 0px;
margin: 0px;
left: 0px;
top: 0px;
}
#jqibox #jqi {
margin-left : -124px !important;
width: 250px !important;
height: 430px !important;
}
.jqiclose {
display: none;
}
.jqimessage {
width : 100%;
text-align: center;
line-height: 1.4em;
position : relative;
}
.jqimessage div {
border : 1px solid #FFFFFF;
border-color : #FFFFFF transparent;
padding : 20px 0;
}
.jqimessage div:before {
height : 1px;
width : 100%;
border-top : 1px solid #FFFFFF;
content : "";
position : absolute;
top : 50px;
padding : 0;
margin : 0;
left : 0;
}
.jqimessage div:after {
height : 1px;
width : 100%;
border-top : 1px solid #FFFFFF;
content : "";
position : absolute;
bottom : -3px;
padding : 0;
margin : 0;
left : 0;
}
.jqimessage p {
background : #DEA3BD;
font-size : 18px;
padding : 40px 20px;
width : 210px;
color : #FFFFFF;
line-height: 1.4em;
}
.jqimessage h1 {
margin-top: 21px;
}
.jqibuttons {
text-align: center;
}
.jqibuttons button {
background : #514C8C;
height: 30px;
font-family: Georgia, Times, "Times New Roman", serif;
font-size: 13px;
font-style: italic;
color: #ffffff;
margin: 0;
display : block;
padding: 7px 20px 6px 20px;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
text-decoration: none;
border : none;
margin : 30px auto 0;
cursor : pointer;
float : right;
}
.jqibuttons button.jqidefaultbutton {
background : #E26EA2;
height: 30px;
font-family: Georgia, Times, "Times New Roman", serif;
font-size: 13px;
font-style: italic;
color: #ffffff;
margin: 0;
display : block;
padding: 7px 20px 6px 20px;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
text-decoration: none;
border : none;
margin : 30px auto 0;
cursor : pointer;
float : left;
}
{/literal}</style>
</head>
<body id="product" class="singleCol">
<script type="text/javascript">
// <![CDATA[
// PrestaShop internal settings
var currencySign = '{$currencySign|html_entity_decode:2:"UTF-8"}';
var currencyRate = '{$currencyRate|floatval}';
var currencyFormat = '{$currencyFormat|intval}';
var currencyBlank = '{$currencyBlank|intval}';
var taxRate = {$tax_rate|floatval};
//JS Hook
var oosHookJsCodeFunctions = new Array();
// Parameters
var id_product = '{$product->id|intval}';
var productHasAttributes = {if isset($groups)}true{else}false{/if};
var quantitiesDisplayAllowed = {if $display_qties == 1}true{else}false{/if};
var quantityAvailable = {if $display_qties == 1 && $product->quantity}{$product->quantity}{else}0{/if};
var allowBuyWhenOutOfStock = {if $allow_oosp == 1}true{else}false{/if};
var availableNowValue = '{$product->available_now|escape:'quotes':'UTF-8'}';
var availableLaterValue = '{$product->available_later|escape:'quotes':'UTF-8'}';
var productPriceTaxExcluded = {$product->getPriceWithoutReduct(true)|default:'null'} - {$product->ecotax};
var reduction_percent = {if $product->specificPrice AND $product->specificPrice.reduction AND $product->specificPrice.reduction_type == 'percentage'}{$product->specificPrice.reduction*100}{else}0{/if};
var reduction_price = {if $product->specificPrice AND $product->specificPrice.reduction AND $product->specificPrice.reduction_type == 'amount'}{$product->specificPrice.reduction}{else}0{/if};
var specific_price = {if $product->specificPrice AND $product->specificPrice.price}{$product->specificPrice.price}{else}0{/if};
var specific_currency = {if $product->specificPrice AND $product->specificPrice.id_currency}true{else}false{/if};
var group_reduction = '{$group_reduction}';
var default_eco_tax = {$product->ecotax};
var ecotaxTax_rate = {$ecotaxTax_rate};
var currentDate = '{$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'}';
var maxQuantityToAllowDisplayOfLastQuantityMessage = {$last_qties};
var noTaxForThisProduct = {if $no_tax == 1}true{else}false{/if};
var displayPrice = {$priceDisplay};
var productReference = '{$product->reference|escape:'htmlall':'UTF-8'}';
var productAvailableForOrder = {if (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE}'0'{else}'{$product->available_for_order}'{/if};
var productShowPrice = '{if !$PS_CATALOG_MODE}{$product->show_price}{else}0{/if}';
var productUnitPriceRatio = '{$product->unit_price_ratio}';
var idDefaultImage = {if isset($cover.id_image_only)}{$cover.id_image_only}{else}0{/if};
// Customizable field
var img_ps_dir = '{$img_ps_dir}';
var customizationFields = new Array();
{assign var='imgIndex' value=0}
{assign var='textFieldIndex' value=0}
{foreach from=$customizationFields item='field' name='customizationFields'}
{assign var="key" value="pictures_`$product->id`_`$field.id_customization_field`"}
customizationFields[{$smarty.foreach.customizationFields.index|intval}] = new Array();
customizationFields[{$smarty.foreach.customizationFields.index|intval}][0] = '{if $field.type|intval == 0}img{$imgIndex++}{else}textField{$textFieldIndex++}{/if}';
customizationFields[{$smarty.foreach.customizationFields.index|intval}][1] = {if $field.type|intval == 0 && isset($pictures.$key) && $pictures.$key}2{else}{$field.required|intval}{/if};
{/foreach}
// Images
var img_prod_dir = '{$img_prod_dir}';
var combinationImages = new Array();
{if isset($combinationImages)}
{foreach from=$combinationImages item='combination' key='combinationId' name='f_combinationImages'}
combinationImages[{$combinationId}] = new Array();
{foreach from=$combination item='image' name='f_combinationImage'}
combinationImages[{$combinationId}][{$smarty.foreach.f_combinationImage.index}] = {$image.id_image|intval};
{/foreach}
{/foreach}
{/if}
combinationImages[0] = new Array();
{if isset($images)}
{foreach from=$images item='image' name='f_defaultImages'}
combinationImages[0][{$smarty.foreach.f_defaultImages.index}] = {$image.id_image};
{/foreach}
{/if}
// Translations
var doesntExist = '{l s='The product does not exist in this model. Please choose another.' mod='expresscart' js=1}';
var doesntExistNoMore = '{l s='This product is no longer in stock' mod='expresscart' js=1}';
var doesntExistNoMoreBut = '{l s='with those attributes but is available with others' mod='expresscart' js=1}';
var uploading_in_progress = '{l s='Uploading in progress, please wait...' mod='expresscart' js=1}';
var fieldRequired = '{l s='Please fill in all required fields, then save the customization.' mod='expresscart' js=1}';
var quantityAvailableSentence = '{l s='Warning: X items in stock!' mod='expresscart' js=1}';
var oneQuantityAvailableSentence = '{l s='Warning: 1 item in stock!' mod='expresscart' js=1}';
{if isset($groups)}
// Combinations
{foreach from=$combinations key=idCombination item=combination}
addCombination({$idCombination|intval}, new Array({$combination.list}), {$combination.quantity}, {$combination.price}, {$combination.ecotax}, {$combination.id_image}, '{$combination.reference|addslashes}', {$combination.unit_impact}, {$combination.minimal_quantity});
{/foreach}
// Colors
{if $colors|@count > 0}
{if $product->id_color_default}var id_color_default = {$product->id_color_default|intval};{/if}
{/if}
{/if}
{literal}
$(".jqidefaultbutton").click(function(){
alert("ok");
});
{/literal}
//]]>
</script>
{if isset($colors) && $colors}
<!-- colors -->
<div id="color_picker">
<p>{l s='Pick a color:' mod='expresscart' js=1}</p>
<div class="clear"></div>
<ul id="color_to_pick_list">
{foreach from=$colors key='id_attribute' item='color'}
<li><a id="color_{$id_attribute|intval}" class="color_pick" style="background: {$color.value};" onclick="updateColorSelect({$id_attribute|intval});$('#wrapResetImages').show('slow');" title="{$color.name}">{if file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')}<img src="{$img_col_dir}{$id_attribute}.jpg" alt="{$color.name}" width="20" height="20" />{/if}</a></li>
{/foreach}
</ul>
<div class="clear"></div>
</div>
{/if}
{if ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)}
<!-- add to cart form-->
<form id="buy_block_footer" {if $PS_CATALOG_MODE AND !isset($groups) AND $product->quantity > 0}class="hidden"{/if} action="{$link->getPageLink('cart.php')}" method="post">
<!-- hidden datas -->
<p class="hidden">
<input type="hidden" name="token" value="{$static_token}" />
<input type="hidden" name="id_product" value="{$product->id|intval}" id="product_page_product_id" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="id_product_attribute" id="idCombination" value="" />
<input type="hidden" name="category_name" id="category_name" value="{$category_name}" />
</p>
<h1 class="product_footer_title">{$product->name}</h1>
<div class="border-separator"></div>
<div class="border-separator"></div>
<div class="center_element">
{assign var=id_image value=Product::getCover($product->id)}
<img src="{$link->getImageLink($product->link_rewrite, $product->id|cat:'-'|cat:$id_image.id_image, 'small')}" alt="{$product->name|escape:'htmlall':'UTF-8'}" />
<div class="right_element">
{if isset($groups)}
<!-- attributes -->
<div id="attributes">
{foreach from=$groups key=id_attribute_group item=group}
{if $group.attributes|@count}
<p>
<label for="group_{$id_attribute_group|intval}">{$group.name|escape:'htmlall':'UTF-8'} :</label>
{assign var="groupName" value="group_$id_attribute_group"}
<select name="{$groupName}" id="group_{$id_attribute_group|intval}" onchange="javascript:findCombination();{if $colors|@count > 0}$('#wrapResetImages').show('slow');{/if};">
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if} title="{$group_attribute|escape:'htmlall':'UTF-8'}">{$group_attribute|escape:'htmlall':'UTF-8'}</option>
{/foreach}
</select>
</p>
{/if}
{/foreach}
</div>
{/if}
<div class="quantity_wanted">
<!-- quantity wanted -->
<p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
<label>{l s='Quantity :' mod='expresscart'}</label>
<input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} />
</p>
<!-- minimal quantity wanted -->
<p id="minimal_quantity_wanted_p"{if $product->minimal_quantity <= 1 OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>{l s='You must add ' mod='expresscart'} <b id="minimal_quantity_label">{$product->minimal_quantity}</b> {l s=' as a minimum quantity to buy this product.' mod='expresscart'}</p>
{if $product->minimal_quantity > 1}
<script type="text/javascript">
checkMinimalQuantity();
</script>
{/if}
</div>
</div>
</div>
<div id="prices_display">
<!-- prices -->
{if $product->show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}
{if !$priceDisplay || $priceDisplay == 2}
{assign var='productPrice' value=$product->getPrice(true, $smarty.const.NULL, 2)}
{assign var='productPriceWithoutRedution' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)}
{elseif $priceDisplay == 1}
{assign var='productPrice' value=$product->getPrice(false, $smarty.const.NULL, 2)}
{assign var='productPriceWithoutRedution' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)}
{/if}
<div class="price">
{if $priceDisplay >= 0 && $priceDisplay <= 2}
<p class="our_price_display">
<span class="bold" id="our_price_display">{convertPrice price=$productPrice}</span>
</p>
{/if}
{if $product->specificPrice AND $product->specificPrice.reduction}
<p id="old_price">
<span class="bold">
{if $priceDisplay >= 0 && $priceDisplay <= 2}
{if $productPriceWithoutRedution > $productPrice}
<span id="old_price_display">{convertPrice price=$productPriceWithoutRedution}</span>
{if isset($product->specificPrice.reduction) && $product->specificPrice.reduction>0}
{assign var='reduction' value=$product->specificPrice.reduction*100}
<span id="reduction">{l s='(-'}{$reduction|ceil} {l s='%)'}</span>
{/if}
{/if}
{/if}
</span>
</p>
{/if}
{if $priceDisplay == 2}
<p id="pretaxe_price"><span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL, 2)}</span>&nbsp;{l s='tax excl.' mod='expresscart'}</p>
{/if}
</div>
{if $product->ecotax != 0}
<p class="price-ecotax">{l s='include' mod='expresscart'} <span id="ecotax_price_display">{if $priceDisplay == 2}{$ecotax_tax_exc|convertAndFormatPrice}{else}{$ecotax_tax_inc|convertAndFormatPrice}{/if}</span> {l s='for green tax' mod='expresscart'}
{if $product->specificPrice AND $product->specificPrice.reduction}
<br />{l s='(not impacted by the discount)' mod='expresscart'}
{/if}
</p>
{/if}
{if !empty($product->unity) && $product->unit_price_ratio > 0.000000}
{math equation="pprice / punit_price" pprice=$productPrice punit_price=$product->unit_price_ratio assign=unit_price}
<p class="unit-price"><span id="unit_price_display">{convertPrice price=$unit_price}</span> {l s='per' mod='expresscart'} {$product->unity|escape:'htmlall':'UTF-8'}</p>
{/if}
{/if}
<p id="add_to_cart_product_footer" class="button"><input type="submit" name="Submit" value="{l s='Add to cart' mod='expresscart'}" class="exclusive" /></p>
</div>
<div style="clear: both;"></div>
<p id="availability_statut"{if ($product->quantity <= 0 && !$product->available_later && $allow_oosp) OR ($product->quantity > 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
<span id="availability_value"{if $product->quantity <= 0} class="warning_inline"{/if}>
{if $product->quantity <= 0}{if $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock' mod='expresscart'}{/if}{else}{$product->available_now}{/if}
</span>
</p>
<div class="border-separator"></div>
<div class="border-separator"></div>
</form>
{/if}
<div class="product_added_to_cart">
<p>{l s='Product added to your cart' mod='expresscart'}</p>
</div>
</body>
<script type="text/javascript">
{literal}
$( document ).ready(function() {
$('#add_to_cart_product_footer').click(function(){
$(this).hide();
var idProduct = $('#buy_block_footer input[name="id_product"]').val();
var idAttribute = $('#buy_block_footer input[name="id_product_attribute"]').val();
var quantity = $('#buy_block_footer #quantity_wanted').val();
if ($(this).attr('disabled') != 'disabled' && $('#buy_block_footer #quantity_wanted:visible').length > 0){
$.ajax({
type: 'POST',
url: baseDir + 'cart.php',
async: true,
cache: false,
dataType : "json",
data: 'add=1&ajax=true&qty=' + quantity +'&id_product=' + idProduct + '&ipa=' + idAttribute + '&token=' + static_token,
success: function(jsonData,textStatus,jqXHR)
{
window.parent.ajaxCart.updateCartInformation(jsonData, false);
if (jsonData.hasError !== true) {
window.parent.$('.ajax_add_to_cart_product_footer_button').removeClass('active');
window.parent.$('a.close_popup_footer').remove();
// send add to cart information to GA
var prod_price = $('#our_price_display').text();
prod_price = prod_price.replace(",",".");
prod_price = prod_price.replace("€","");
productToGA = {
"id" : idProduct,
"variant" : idAttribute,
"name" : ""+$('.product_footer_title').text()+"",
"brand" : ""+$('#category_name').val()+"",
"category" : ""+$('#category_name').val()+"",
"price" : prod_price.trim(),
"qty" : quantity
};
if (window.parent.ga && window.parent.ga.create){
window.parent.addToCartToGA(productToGA);
}
$('.product_added_to_cart').show();
setTimeout(function() {
$('.product_added_to_cart').hide();
window.parent.hideFooterExpressCart();
}, 2000);
}
},
error: function(XMLHttpRequest, textStatus, errorThrown)
{
alert("TECHNICAL ERROR: unable to add the product.\n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
}
});
}
return false;
});
});
{/literal}
</script>
</html>