501 lines
16 KiB
Smarty
Executable File
501 lines
16 KiB
Smarty
Executable File
<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="{$base_dir_ssl}/themes/site_mobile/js/tools.js"></script>
|
|
<script type="text/javascript" src="{$base_dir_ssl}/themes/site_mobile/js/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>
|
|
<select name="qty" id="quantity_wanted" class="text" {if $product->minimal_quantity > 1}onchange="checkMinimalQuantity({$product->minimal_quantity});"{/if}>
|
|
{assign var="qtySelected" value="1"}
|
|
{if isset($quantityBackup)}
|
|
{assign var="qtySelected" value=$quantityBackup|intval}
|
|
{else}
|
|
{if $product->minimal_quantity > 1}
|
|
{assign var="qtySelected" value=$product->minimal_quantity}
|
|
{/if}
|
|
{/if}
|
|
{for $qty=1 to 10}
|
|
<option value="{$qty}"{if $qtySelected == $qty} selected{/if}>{$qty}</option>
|
|
{/for}
|
|
</select>
|
|
</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}
|