Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into bootstrap

Conflicts:
	admin-dev/themes/default/css/modules.css
	admin-dev/themes/default/template/controllers/carts/helpers/view/view.tpl
	admin-dev/themes/default/template/controllers/groups/helpers/form/form.tpl
	admin-dev/themes/default/template/controllers/groups/helpers/view/view.tpl
	admin-dev/themes/default/template/controllers/products/helpers/form/form.tpl
	admin-dev/themes/default/template/controllers/products/images.tpl
	admin-dev/themes/default/template/controllers/products/prices.tpl
	admin-dev/themes/default/template/helpers/form/form.tpl
	admin-dev/themes/default/template/helpers/list/list_header.tpl
	classes/Autoload.php
	classes/Carrier.php
	classes/Product.php
	classes/ProductSale.php
	classes/Tools.php
	classes/Validate.php
	classes/tax/TaxRulesTaxManager.php
	controllers/admin/AdminPPreferencesController.php
	controllers/admin/AdminPerformanceController.php
	install-dev/install_version.php
	js/admin_carrier_wizard.js
	modules/blockcategories/blockcategories.php
	modules/blocklayered/blocklayered.php
	modules/statsequipment/statsequipment.php
	modules/statsproduct/statsproduct.php
	modules/watermark/watermark.php
	themes/default/address.tpl
	themes/default/authentication.tpl
	themes/default/category.tpl
	themes/default/contact-form.tpl
	themes/default/css/history.css
	themes/default/header.tpl
	themes/default/js/cart-summary.js
	themes/default/js/product.js
	themes/default/mobile/order-detail.tpl
	themes/default/modules/blocksearch/blocksearch.tpl
	themes/default/modules/productcomments/productcomments.tpl
	themes/default/order-carrier.tpl
	themes/default/order-detail.tpl
	themes/default/order-opc-new-account.tpl
	themes/default/product.tpl
This commit is contained in:
Kevin Granger
2013-11-21 17:43:51 +01:00
167 changed files with 7261 additions and 861 deletions
+252
View File
@@ -0,0 +1,252 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<script type="text/javascript">
// <![CDATA[
var idSelectedCountry = {if isset($smarty.post.id_state)}{$smarty.post.id_state|intval}{else}{if isset($address->id_state)}{$address->id_state|intval}{else}false{/if}{/if};
var countries = new Array();
var countriesNeedIDNumber = new Array();
var countriesNeedZipCode = new Array();
{foreach from=$countries item='country'}
{if isset($country.states) && $country.contains_states}
countries[{$country.id_country|intval}] = new Array();
{foreach from=$country.states item='state' name='states'}
countries[{$country.id_country|intval}].push({ldelim}'id' : '{$state.id_state}', 'name' : '{$state.name|addslashes}'{rdelim});
{/foreach}
{/if}
{if $country.need_identification_number}
countriesNeedIDNumber.push({$country.id_country|intval});
{/if}
{if isset($country.need_zip_code)}
countriesNeedZipCode[{$country.id_country|intval}] = {$country.need_zip_code};
{/if}
{/foreach}
$(function(){ldelim}
$('.id_state option[value={if isset($smarty.post.id_state)}{$smarty.post.id_state|intval}{else}{if isset($address->id_state)}{$address->id_state|intval}{/if}{/if}]').attr('selected', true);
{rdelim});
{literal}
$(document).ready(function() {
$('#company').on('input',function(){
vat_number();
});
vat_number();
function vat_number()
{
if ($('#company').val() != '')
$('#vat_number').show();
else
$('#vat_number').hide();
}
});
{/literal}
//]]>
</script>
{capture name=path}{l s='Your addresses'}{/capture}
{include file="$tpl_dir./breadcrumb.tpl"}
<h1>{l s='Your addresses'}</h1>
<h3>
{if isset($id_address) && (isset($smarty.post.alias) || isset($address->alias))}
{l s='Modify address'}
{if isset($smarty.post.alias)}
"{$smarty.post.alias}"
{else}
{if isset($address->alias)}"{$address->alias|escape:'html'}"{/if}
{/if}
{else}
{l s='To add a new address, please fill out the form below.'}
{/if}
</h3>
{include file="$tpl_dir./errors.tpl"}
<p class="required"><sup>*</sup> {l s='Required field'}</p>
<form action="{$link->getPageLink('address', true)|escape:'html'}" method="post" class="std" id="add_address">
<fieldset>
<h3>{if isset($id_address)}{l s='Your address'}{else}{l s='New address'}{/if}</h3>
{assign var="stateExist" value=false}
{assign var="postCodeExist" value=false}
{assign var="dniExist" value=false}
{foreach from=$ordered_adr_fields item=field_name}
{if $field_name eq 'dni'}
{assign var="dniExist" value=true}
<p class="text">
<label for="dni">{l s='Identification number'}</label>
<input type="text" class="text" name="dni" id="dni" value="{if isset($smarty.post.dni)}{$smarty.post.dni}{else}{if isset($address->dni)}{$address->dni|escape:'html'}{/if}{/if}" />
<span class="form_info">{l s='DNI / NIF / NIE'}</span>
</p>
{/if}
{if $field_name eq 'company'}
<p class="text">
<label for="company">{l s='Company'}</label>
<input type="text" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{else}{if isset($address->company)}{$address->company|escape:'html'}{/if}{/if}" />
</p>
{/if}
{if $field_name eq 'vat_number'}
<div id="vat_area">
<div id="vat_number">
<p class="text">
<label for="vat_number">{l s='VAT number'}</label>
<input type="text" class="text" name="vat_number" value="{if isset($smarty.post.vat_number)}{$smarty.post.vat_number}{else}{if isset($address->vat_number)}{$address->vat_number|escape:'html'}{/if}{/if}" />
</p>
</div>
</div>
{/if}
{if $field_name eq 'firstname'}
<p class="required text">
<label for="firstname">{l s='First name'} <sup>*</sup></label>
<input type="text" name="firstname" id="firstname" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{else}{if isset($address->firstname)}{$address->firstname|escape:'html'}{/if}{/if}" />
</p>
{/if}
{if $field_name eq 'lastname'}
<p class="required text">
<label for="lastname">{l s='Last name'} <sup>*</sup></label>
<input type="text" id="lastname" name="lastname" value="{if isset($smarty.post.lastname)}{$smarty.post.lastname}{else}{if isset($address->lastname)}{$address->lastname|escape:'html'}{/if}{/if}" />
</p>
{/if}
{if $field_name eq 'address1'}
<p class="required text">
<label for="address1">{l s='Address'} <sup>*</sup></label>
<input type="text" id="address1" name="address1" value="{if isset($smarty.post.address1)}{$smarty.post.address1}{else}{if isset($address->address1)}{$address->address1|escape:'html'}{/if}{/if}" />
</p>
{/if}
{if $field_name eq 'address2'}
<p class="required text">
<label for="address2">{l s='Address (Line 2)'}</label>
<input type="text" id="address2" name="address2" value="{if isset($smarty.post.address2)}{$smarty.post.address2}{else}{if isset($address->address2)}{$address->address2|escape:'html'}{/if}{/if}" />
</p>
{/if}
{if $field_name eq 'postcode'}
{assign var="postCodeExist" value=true}
<p class="required postcode text">
<label for="postcode">{l s='Zip / Postal Code'} <sup>*</sup></label>
<input type="text" id="postcode" name="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{else}{if isset($address->postcode)}{$address->postcode|escape:'html'}{/if}{/if}" onkeyup="$('#postcode').val($('#postcode').val().toUpperCase());" />
</p>
{/if}
{if $field_name eq 'city'}
<p class="required text">
<label for="city">{l s='City'} <sup>*</sup></label>
<input type="text" name="city" id="city" value="{if isset($smarty.post.city)}{$smarty.post.city}{else}{if isset($address->city)}{$address->city|escape:'html'}{/if}{/if}" maxlength="64" />
</p>
{*
if customer hasn't update his layout address, country has to be verified
but it's deprecated
*}
{/if}
{if $field_name eq 'Country:name' || $field_name eq 'country'}
<p class="required select">
<label for="id_country">{l s='Country'} <sup>*</sup></label>
<select id="id_country" name="id_country">{$countries_list}</select>
</p>
{if $vatnumber_ajax_call}
<script type="text/javascript">
var ajaxurl = '{$ajaxurl}';
{literal}
$(document).ready(function(){
$('#id_country').change(function() {
$.ajax({
type: "GET",
url: ajaxurl+"vatnumber/ajax.php?id_country="+$('#id_country').val(),
success: function(isApplicable){
if(isApplicable == "1")
{
$('#vat_area').show();
$('#vat_number').show();
}
else
{
$('#vat_area').hide();
}
}
});
});
});
{/literal}
</script>
{/if}
{/if}
{if $field_name eq 'State:name'}
{assign var="stateExist" value=true}
<p class="required id_state select">
<label for="id_state">{l s='State'} <sup>*</sup></label>
<select name="id_state" id="id_state">
<option value="">-</option>
</select>
</p>
{/if}
{/foreach}
{if !$postCodeExist}
<p class="required postcode text hidden">
<label for="postcode">{l s='Zip / Postal Code'} <sup>*</sup></label>
<input type="text" id="postcode" name="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{else}{if isset($address->postcode)}{$address->postcode|escape:'html'}{/if}{/if}" onkeyup="$('#postcode').val($('#postcode').val().toUpperCase());" />
</p>
{/if}
{if !$stateExist}
<p class="required id_state select">
<label for="id_state">{l s='State'} <sup>*</sup></label>
<select name="id_state" id="id_state">
<option value="">-</option>
</select>
</p>
{/if}
{if !$dniExist}
<p class="required text dni">
<label for="dni">{l s='Identification number'} <sup>*</sup></label>
<input type="text" class="text" name="dni" id="dni" value="{if isset($smarty.post.dni)}{$smarty.post.dni}{else}{if isset($address->dni)}{$address->dni|escape:'html'}{/if}{/if}" />
<span class="form_info">{l s='DNI / NIF / NIE'}</span>
</p>
{/if}
<p class="textarea">
<label for="other">{l s='Additional information'}</label>
<textarea id="other" name="other" cols="26" rows="3">{if isset($smarty.post.other)}{$smarty.post.other}{else}{if isset($address->other)}{$address->other|escape:'html'}{/if}{/if}</textarea>
</p>
{if isset($one_phone_at_least) && $one_phone_at_least}
<p class="inline-infos required">{l s='You must register at least one phone number.'}</p>
{/if}
<p class="text">
<label for="phone">{l s='Home phone'}</label>
<input type="text" id="phone" name="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{else}{if isset($address->phone)}{$address->phone|escape:'html'}{/if}{/if}" />
</p>
<p class="{if isset($one_phone_at_least) && $one_phone_at_least}required {/if}text">
<label for="phone_mobile">{l s='Mobile phone'}{if isset($one_phone_at_least) && $one_phone_at_least} <sup>*</sup>{/if}</label>
<input type="text" id="phone_mobile" name="phone_mobile" value="{if isset($smarty.post.phone_mobile)}{$smarty.post.phone_mobile}{else}{if isset($address->phone_mobile)}{$address->phone_mobile|escape:'html'}{/if}{/if}" />
</p>
<p class="required text" id="adress_alias">
<label for="alias">{l s='Please assign an address title for future reference.'} <sup>*</sup></label>
<input type="text" id="alias" name="alias" value="{if isset($smarty.post.alias)}{$smarty.post.alias}{else if isset($address->alias)}{$address->alias|escape:'html'}{elseif !$select_address}{l s='My address'}{/if}" />
</p>
</fieldset>
<p class="submit2">
{if isset($id_address)}<input type="hidden" name="id_address" value="{$id_address|intval}" />{/if}
{if isset($back)}<input type="hidden" name="back" value="{$back}" />{/if}
{if isset($mod)}<input type="hidden" name="mod" value="{$mod}" />{/if}
{if isset($select_address)}<input type="hidden" name="select_address" value="{$select_address|intval}" />{/if}
<input type="hidden" name="token" value="{$token}" />
<input type="submit" name="submitAddress" id="submitAddress" value="{l s='Save'}" class="button" />
</p>
</form>
+741
View File
@@ -0,0 +1,741 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{capture name=path}
{if !isset($email_create)}{l s='Authentication'}{else}
<a href="{$link->getPageLink('authentication', true)|escape:'html'}" rel="nofollow" title="{l s='Authentication'}">{l s='Authentication'}</a>
<span class="navigation-pipe">{$navigationPipe}</span>{l s='Create your account'}
{/if}
{/capture}
{include file="$tpl_dir./breadcrumb.tpl"}
<script type="text/javascript">
// <![CDATA[
var idSelectedCountry = {if isset($smarty.post.id_state)}{$smarty.post.id_state|intval}{else}false{/if};
var countries = new Array();
var countriesNeedIDNumber = new Array();
var countriesNeedZipCode = new Array();
{if isset($countries)}
{foreach from=$countries item='country'}
{if isset($country.states) && $country.contains_states}
countries[{$country.id_country|intval}] = new Array();
{foreach from=$country.states item='state' name='states'}
countries[{$country.id_country|intval}].push({ldelim}'id' : '{$state.id_state|intval}', 'name' : '{$state.name|addslashes}'{rdelim});
{/foreach}
{/if}
{if $country.need_identification_number}
countriesNeedIDNumber.push({$country.id_country|intval});
{/if}
{if isset($country.need_zip_code)}
countriesNeedZipCode[{$country.id_country|intval}] = {$country.need_zip_code};
{/if}
{/foreach}
{/if}
//]]>
{literal}
$(document).ready(function() {
$('#company').on('input',function(){
vat_number();
});
$('#company_invoice').on('input',function(){
vat_number_invoice();
});
function vat_number()
{
if (($('#company').length) && ($('#company').val() != ''))
$('#vat_number').show();
else
$('#vat_number').hide();
}
function vat_number_invoice()
{
if (($('#company_invoice').length) && ($('#company_invoice').val() != ''))
$('#vat_number_block_invoice').show();
else
$('#vat_number_block_invoice').hide();
}
vat_number();
vat_number_invoice();
{/literal}
$('.id_state option[value={if isset($smarty.post.id_state)}{$smarty.post.id_state|intval}{/if}]').prop('selected', true);
{literal}
});
{/literal}
</script>
<h1>{if !isset($email_create)}{l s='Authentication'}{else}{l s='Create an account'}{/if}</h1>
{if !isset($back) || $back != 'my-account'}{assign var='current_step' value='login'}{include file="$tpl_dir./order-steps.tpl"}{/if}
{include file="$tpl_dir./errors.tpl"}
{assign var='stateExist' value=false}
{assign var="postCodeExist" value=false}
{assign var="dniExist" value=false}
{if !isset($email_create)}
<script type="text/javascript">
{literal}
$(document).ready(function(){
// Retrocompatibility with 1.4
if (typeof baseUri === "undefined" && typeof baseDir !== "undefined")
baseUri = baseDir;
$('#create-account_form').submit(function(){
submitFunction();
return false;
});
$('#invoice_address').click(function() {
bindCheckbox();
});
bindCheckbox();
});
function submitFunction()
{
$('#create_account_error').html('').hide();
//send the ajax request to the server
$.ajax({
type: 'POST',
url: baseUri,
async: true,
cache: false,
dataType : "json",
data: {
controller: 'authentication',
SubmitCreate: 1,
ajax: true,
email_create: $('#email_create').val(),
back: $('input[name=back]').val(),
token: token
},
success: function(jsonData)
{
if (jsonData.hasError)
{
var errors = '';
for(error in jsonData.errors)
//IE6 bug fix
if(error != 'indexOf')
errors += '<li>'+jsonData.errors[error]+'</li>';
$('#create_account_error').html('<ol>'+errors+'</ol>').show();
}
else
{
// adding a div to display a transition
$('#center_column').html('<div id="noSlide">'+$('#center_column').html()+'</div>');
$('#noSlide').fadeOut('slow', function(){
$('#noSlide').html(jsonData.page);
// update the state (when this file is called from AJAX you still need to update the state)
bindStateInputAndUpdate();
$(this).fadeIn('slow', function(){
document.location = '#account-creation';
});
});
}
},
error: function(XMLHttpRequest, textStatus, errorThrown)
{
alert("TECHNICAL ERROR: unable to load form.\n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
}
});
}
function bindCheckbox()
{
if ($('#invoice_address:checked').length > 0)
{
$('#opc_invoice_address').slideDown('slow');
if ($('#company_invoice').val() == '')
$('#vat_number_block_invoice').hide();
updateState('invoice');
updateNeedIDNumber('invoice');
updateZipCode('invoice');
{/literal}
$('.id_state option[value={if isset($smarty.post.id_state)}{$smarty.post.id_state|intval}{/if}]').prop('selected', true);
$('.id_state_invoice option[value={if isset($smarty.post.id_state_invoice)}{$smarty.post.id_state_invoice|intval}{/if}]').prop('selected', true);
{literal}
}
else
$('#opc_invoice_address').slideUp('slow');
}
{/literal}
</script>
<!--{if isset($authentification_error)}
<div class="error">
{if {$authentification_error|@count} == 1}
<p>{l s='There\'s at least one error'} :</p>
{else}
<p>{l s='There are %s errors' sprintf=[$account_error|@count]} :</p>
{/if}
<ol>
{foreach from=$authentification_error item=v}
<li>{$v}</li>
{/foreach}
</ol>
</div>
{/if}-->
<form action="{$link->getPageLink('authentication', true)|escape:'html'}" method="post" id="create-account_form" class="std">
<fieldset>
<h3>{l s='Create an account'}</h3>
<div class="form_content clearfix">
<p class="title_block">{l s='Please enter your email address to create an account.'}</p>
<div class="error" id="create_account_error" style="display:none"></div>
<p class="text">
<label for="email_create">{l s='Email address'}</label>
<span><input type="text" id="email_create" name="email_create" value="{if isset($smarty.post.email_create)}{$smarty.post.email_create|stripslashes}{/if}" class="account_input" /></span>
</p>
<p class="submit">
{if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back}" />{/if}
<input type="submit" id="SubmitCreate" name="SubmitCreate" class="button_large" value="{l s='Create an account'}" />
<input type="hidden" class="hidden" name="SubmitCreate" value="{l s='Create an account'}" />
</p>
</div>
</fieldset>
</form>
<form action="{$link->getPageLink('authentication', true)|escape:'html'}" method="post" id="login_form" class="std">
<fieldset>
<h3>{l s='Already registered?'}</h3>
<div class="form_content clearfix">
<p class="text">
<label for="email">{l s='Email address'}</label>
<span><input type="text" id="email" name="email" value="{if isset($smarty.post.email)}{$smarty.post.email|stripslashes}{/if}" class="account_input" /></span>
</p>
<p class="text">
<label for="passwd">{l s='Password'}</label>
<span><input type="password" id="passwd" name="passwd" value="{if isset($smarty.post.passwd)}{$smarty.post.passwd|stripslashes}{/if}" class="account_input" /></span>
</p>
<p class="lost_password"><a href="{$link->getPageLink('password')|escape:'html'}" title="{l s='Recover your forgotten password'}" rel="nofollow">{l s='Forgot your password?'}</a></p>
<p class="submit">
{if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back|escape:'htmlall':'UTF-8'}" />{/if}
<input type="submit" id="SubmitLogin" name="SubmitLogin" class="button" value="{l s='Authentication'}" />
</p>
</div>
</fieldset>
</form>
{if isset($inOrderProcess) && $inOrderProcess && $PS_GUEST_CHECKOUT_ENABLED}
<form action="{$link->getPageLink('authentication', true, NULL, "back=$back")|escape:'html'}" method="post" id="new_account_form" class="std clearfix">
<fieldset>
<h3>{l s='Instant checkout'}</h3>
<div id="opc_account_form" style="display: block; ">
<!-- Account -->
<p class="required text">
<label for="guest_email">{l s='Email address'} <sup>*</sup></label>
<input type="text" class="text" id="guest_email" name="guest_email" value="{if isset($smarty.post.guest_email)}{$smarty.post.guest_email}{/if}" />
</p>
<p class="radio required">
<span>{l s='Title'}</span>
{foreach from=$genders key=k item=gender}
<input type="radio" name="id_gender" id="id_gender{$gender->id}" value="{$gender->id}"{if isset($smarty.post.id_gender) && $smarty.post.id_gender == $gender->id} checked="checked"{/if} />
<label for="id_gender{$gender->id}" class="top">{$gender->name}</label>
{/foreach}
</p>
<p class="required text">
<label for="firstname">{l s='First name'} <sup>*</sup></label>
<input type="text" class="text" id="firstname" name="firstname" onblur="$('#customer_firstname').val($(this).val());" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{/if}" />
<input type="hidden" class="text" id="customer_firstname" name="customer_firstname" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{/if}" />
</p>
<p class="required text">
<label for="lastname">{l s='Last name'} <sup>*</sup></label>
<input type="text" class="text" id="lastname" name="lastname" onblur="$('#customer_lastname').val($(this).val());" value="{if isset($smarty.post.lastname)}{$smarty.post.lastname}{/if}" />
<input type="hidden" class="text" id="customer_lastname" name="customer_lastname" value="{if isset($smarty.post.lastname)}{$smarty.post.lastname}{/if}" />
</p>
<p class="select">
<span>{l s='Date of Birth'}</span>
<select id="days" name="days">
<option value="">-</option>
{foreach from=$days item=day}
<option value="{$day}" {if ($sl_day == $day)} selected="selected"{/if}>{$day}&nbsp;&nbsp;</option>
{/foreach}
</select>
{*
{l s='January'}
{l s='February'}
{l s='March'}
{l s='April'}
{l s='May'}
{l s='June'}
{l s='July'}
{l s='August'}
{l s='September'}
{l s='October'}
{l s='November'}
{l s='December'}
*}
<select id="months" name="months">
<option value="">-</option>
{foreach from=$months key=k item=month}
<option value="{$k}" {if ($sl_month == $k)} selected="selected"{/if}>{l s=$month}&nbsp;</option>
{/foreach}
</select>
<select id="years" name="years">
<option value="">-</option>
{foreach from=$years item=year}
<option value="{$year}" {if ($sl_year == $year)} selected="selected"{/if}>{$year}&nbsp;&nbsp;</option>
{/foreach}
</select>
</p>
{if isset($newsletter) && $newsletter}
<p class="checkbox">
<input type="checkbox" name="newsletter" id="newsletter" value="1" {if isset($smarty.post.newsletter) && $smarty.post.newsletter == '1'}checked="checked"{/if} autocomplete="off"/>
<label for="newsletter">{l s='Sign up for our newsletter!'}</label>
</p>
<p class="checkbox">
<input type="checkbox" name="optin" id="optin" value="1" {if isset($smarty.post.optin) && $smarty.post.optin == '1'}checked="checked"{/if} autocomplete="off"/>
<label for="optin">{l s='Receive special offers from our partners!'}</label>
</p>
{/if}
<h3>{l s='Delivery address'}</h3>
{foreach from=$dlv_all_fields item=field_name}
{if $field_name eq "company" && $b2b_enable}
<p class="text">
<label for="company">{l s='Company'}</label>
<input type="text" class="text" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{/if}" />
</p>
{elseif $field_name eq "vat_number"}
<div id="vat_number" style="display:none;">
<p class="text">
<label for="vat_number">{l s='VAT number'}</label>
<input type="text" class="text" name="vat_number" value="{if isset($smarty.post.vat_number)}{$smarty.post.vat_number}{/if}" />
</p>
</div>
{elseif $field_name eq "dni"}
{assign var='dniExist' value=true}
<p class="text">
<label for="dni">{l s='Identification number'}</label>
<input type="text" class="text" name="dni" id="dni" value="{if isset($smarty.post.dni)}{$smarty.post.dni}{/if}" />
<span class="form_info">{l s='DNI / NIF / NIE'}</span>
</p>
{elseif $field_name eq "address1"}
<p class="required text">
<label for="address1">{l s='Address'} <sup>*</sup></label>
<input type="text" class="text" name="address1" id="address1" value="{if isset($smarty.post.address1)}{$smarty.post.address1}{/if}" />
</p>
{elseif $field_name eq "postcode"}
{assign var='postCodeExist' value=true}
<p class="required postcode text">
<label for="postcode">{l s='Zip / Postal Code'} <sup>*</sup></label>
<input type="text" class="text" name="postcode" id="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{/if}" onblur="$('#postcode').val($('#postcode').val().toUpperCase());" />
</p>
{elseif $field_name eq "city"}
<p class="required text">
<label for="city">{l s='City'} <sup>*</sup></label>
<input type="text" class="text" name="city" id="city" value="{if isset($smarty.post.city)}{$smarty.post.city}{/if}" />
</p>
<!--
if customer hasn't update his layout address, country has to be verified
but it's deprecated
-->
{elseif $field_name eq "Country:name" || $field_name eq "country"}
<p class="required select">
<label for="id_country">{l s='Country'} <sup>*</sup></label>
<select name="id_country" id="id_country">
{foreach from=$countries item=v}
<option value="{$v.id_country}"{if (isset($smarty.post.id_country) AND $smarty.post.id_country == $v.id_country) OR (!isset($smarty.post.id_country) && $sl_country == $v.id_country)} selected="selected"{/if}>{$v.name}</option>
{/foreach}
</select>
</p>
{elseif $field_name eq "State:name"}
{assign var='stateExist' value=true}
<p class="required id_state select">
<label for="id_state">{l s='State'} <sup>*</sup></label>
<select name="id_state" id="id_state">
<option value="">-</option>
</select>
</p>
{/if}
{/foreach}
{if $postCodeExist eq false}
<p class="required postcode text hidden">
<label for="postcode">{l s='Zip / Postal Code'} <sup>*</sup></label>
<input type="text" class="text" name="postcode" id="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{/if}" onblur="$('#postcode').val($('#postcode').val().toUpperCase());" />
</p>
{/if}
{if $stateExist eq false}
<p class="required id_state select hidden">
<label for="id_state">{l s='State'} <sup>*</sup></label>
<select name="id_state" id="id_state">
<option value="">-</option>
</select>
</p>
{/if}
{if $dniExist eq false}
<p class="required text dni">
<label for="dni">{l s='Identification number'} <sup>*</sup></label>
<input type="text" class="text" name="dni" id="dni" value="{if isset($smarty.post.dni)}{$smarty.post.dni}{/if}" />
<span class="form_info">{l s='DNI / NIF / NIE'}</span>
</p>
{/if}
<p class="{if isset($one_phone_at_least) && $one_phone_at_least}required {/if}text">
<label for="phone_mobile">{l s='Mobile phone'}{if isset($one_phone_at_least) && $one_phone_at_least} <sup>*</sup>{/if}</label>
<input type="text" class="text" name="phone_mobile" id="phone_mobile" value="{if isset($smarty.post.phone_mobile)}{$smarty.post.phone_mobile}{/if}" />
</p>
<input type="hidden" name="alias" id="alias" value="{l s='My address'}" />
<input type="hidden" name="is_new_customer" id="is_new_customer" value="0" />
<p class="checkbox">
<input type="checkbox" name="invoice_address" id="invoice_address"{if isset($smarty.post.invoice_address) && $smarty.post.invoice_address} checked="checked"{/if} autocomplete="off"/>
<label for="invoice_address"><b>{l s='Please use another address for invoice'}</b></label>
</p>
<div id="opc_invoice_address" class="hidden">
{assign var=stateExist value=false}
{assign var=postCodeExist value=false}
{assign var=dniExist value=false}
<h3>{l s='Invoice address'}</h3>
{foreach from=$inv_all_fields item=field_name}
{if $field_name eq "company" && $b2b_enable}
<p class="text">
<label for="company_invoice">{l s='Company'}</label>
<input type="text" class="text" id="company_invoice" name="company_invoice" value="{if isset($smarty.post.company_invoice)}{$smarty.post.company_invoice}{/if}" />
</p>
{elseif $field_name eq "vat_number"}
<div id="vat_number_block_invoice" class="hidden">
<p class="text">
<label for="vat_number_invoice">{l s='VAT number'}</label>
<input type="text" class="text" id="vat_number_invoice" name="vat_number_invoice" value="{if isset($smarty.post.vat_number_invoice)}{$smarty.post.vat_number_invoice}{/if}" />
</p>
</div>
{elseif $field_name eq "dni"}
{assign var=dniExist value=true}
<p class="text">
<label for="dni_invoice">{l s='Identification number'}</label>
<input type="text" class="text" name="dni_invoice" id="dni_invoice" value="{if isset($smarty.post.dni_invoice)}{$smarty.post.dni_invoice}{/if}" />
<span class="form_info">{l s='DNI / NIF / NIE'}</span>
</p>
{elseif $field_name eq "firstname"}
<p class="required text">
<label for="firstname_invoice">{l s='First name'} <sup>*</sup></label>
<input type="text" class="text" id="firstname_invoice" name="firstname_invoice" value="{if isset($smarty.post.firstname_invoice)}{$smarty.post.firstname_invoice}{/if}" />
</p>
{elseif $field_name eq "lastname"}
<p class="required text">
<label for="lastname_invoice">{l s='Last name'} <sup>*</sup></label>
<input type="text" class="text" id="lastname_invoice" name="lastname_invoice" value="{if isset($smarty.post.firstname_invoice)}{$smarty.post.firstname_invoice}{/if}" />
</p>
{elseif $field_name eq "address1"}
<p class="required text">
<label for="address1_invoice">{l s='Address'} <sup>*</sup></label>
<input type="text" class="text" name="address1_invoice" id="address1_invoice" value="{if isset($smarty.post.address1_invoice)}{$smarty.post.address1_invoice}{/if}" />
</p>
{elseif $field_name eq "postcode"}
{$postCodeExist = true}
<p class="required postcode_invoice text">
<label for="postcode_invoice">{l s='Zip / Postal Code'} <sup>*</sup></label>
<input type="text" class="text" name="postcode_invoice" id="postcode_invoice" value="{if isset($smarty.post.postcode_invoice)}{$smarty.post.postcode_invoice}{/if}" onkeyup="$('#postcode').val($('#postcode').val().toUpperCase());" />
</p>
{elseif $field_name eq "city"}
<p class="required text">
<label for="city_invoice">{l s='City'} <sup>*</sup></label>
<input type="text" class="text" name="city_invoice" id="city_invoice" value="{if isset($smarty.post.city_invoice)}{$smarty.post.city_invoice}{/if}" />
</p>
{elseif $field_name eq "country" || $field_name eq "Country:name"}
<p class="required select">
<label for="id_country_invoice">{l s='Country'} <sup>*</sup></label>
<select name="id_country_invoice" id="id_country_invoice">
<option value="">-</option>
{foreach from=$countries item=v}
<option value="{$v.id_country}"{if (isset($smarty.post.id_country_invoice) && $smarty.post.id_country_invoice == $v.id_country) OR (!isset($smarty.post.id_country_invoice) && $sl_country == $v.id_country)} selected="selected"{/if}>{$v.name|escape:'htmlall':'UTF-8'}</option>
{/foreach}
</select>
</p>
{elseif $field_name eq "state" || $field_name eq 'State:name'}
{$stateExist = true}
<p class="required id_state_invoice select" style="display:none;">
<label for="id_state_invoice">{l s='State'} <sup>*</sup></label>
<select name="id_state_invoice" id="id_state_invoice">
<option value="">-</option>
</select>
</p>
{/if}
{/foreach}
{if !$postCodeExist}
<p class="required postcode_invoice text hidden">
<label for="postcode_invoice">{l s='Zip / Postal Code'} <sup>*</sup></label>
<input type="text" class="text" name="postcode_invoice" id="postcode_invoice" value="{if isset($smarty.post.postcode_invoice)}{$smarty.post.postcode_invoice}{/if}" onkeyup="$('#postcode').val($('#postcode').val().toUpperCase());" />
</p>
{/if}
{if !$stateExist}
<p class="required id_state_invoice select hidden">
<label for="id_state_invoice">{l s='State'} <sup>*</sup></label>
<select name="id_state_invoice" id="id_state_invoice">
<option value="">-</option>
</select>
</p>
{/if}
{if !$dniExist}
<p class="required text dni_invoice">
<label for="dni_invoice">{l s='Identification number'} <sup>*</sup></label>
<input type="text" class="text" name="dni_invoice" id="dni_invoice" value="{if isset($smarty.post.dni_invoice)}{$smarty.post.dni_invoice}{/if}" />
<span class="form_info">{l s='DNI / NIF / NIE'}</span>
</p>
{/if}
<p class="{if isset($one_phone_at_least) && $one_phone_at_least}required {/if}text">
<label for="phone_mobile_invoice">{l s='Mobile phone'}{if isset($one_phone_at_least) && $one_phone_at_least} <sup>*</sup>{/if}</label>
<input type="text" class="text" name="phone_mobile_invoice" id="phone_mobile_invoice" value="{if isset($smarty.post.phone_mobile_invoice)}{$smarty.post.phone_mobile_invoice}{/if}" />
</p>
<input type="hidden" name="alias_invoice" id="alias_invoice" value="{l s='My Invoice address'}" />
</div>
</div>
</fieldset>
{$HOOK_CREATE_ACCOUNT_FORM}
<p class="cart_navigation required submit">
<span><sup>*</sup>{l s='Required field'}</span>
<input type="hidden" name="display_guest_checkout" value="1" />
<input type="submit" class="exclusive" name="submitGuestAccount" id="submitGuestAccount" value="{l s='Continue'}" />
</p>
</form>
{/if}
{else}
<!--{if isset($account_error)}
<div class="error">
{if {$account_error|@count} == 1}
<p>{l s='There\'s at least one error'} :</p>
{else}
<p>{l s='There are %s errors' sprintf=[$account_error|@count]} :</p>
{/if}
<ol>
{foreach from=$account_error item=v}
<li>{$v}</li>
{/foreach}
</ol>
</div>
{/if}-->
<form action="{$link->getPageLink('authentication', true)|escape:'html'}" method="post" id="account-creation_form" class="std">
{$HOOK_CREATE_ACCOUNT_TOP}
<fieldset class="account_creation">
<h3>{l s='Your personal information'}</h3>
<p class="radio required">
<span>{l s='Title'}</span>
{foreach from=$genders key=k item=gender}
<input type="radio" name="id_gender" id="id_gender{$gender->id}" value="{$gender->id}" {if isset($smarty.post.id_gender) && $smarty.post.id_gender == $gender->id}checked="checked"{/if} />
<label for="id_gender{$gender->id}" class="top">{$gender->name}</label>
{/foreach}
</p>
<p class="required text">
<label for="customer_firstname">{l s='First name'} <sup>*</sup></label>
<input onkeyup="$('#firstname').val(this.value);" type="text" class="text" id="customer_firstname" name="customer_firstname" value="{if isset($smarty.post.customer_firstname)}{$smarty.post.customer_firstname}{/if}" />
</p>
<p class="required text">
<label for="customer_lastname">{l s='Last name'} <sup>*</sup></label>
<input onkeyup="$('#lastname').val(this.value);" type="text" class="text" id="customer_lastname" name="customer_lastname" value="{if isset($smarty.post.customer_lastname)}{$smarty.post.customer_lastname}{/if}" />
</p>
<p class="required text">
<label for="email">{l s='Email'} <sup>*</sup></label>
<input type="text" class="text" id="email" name="email" value="{if isset($smarty.post.email)}{$smarty.post.email}{/if}" />
</p>
<p class="required password">
<label for="passwd">{l s='Password'} <sup>*</sup></label>
<input type="password" class="text" name="passwd" id="passwd" />
<span class="form_info">{l s='(Five characters minimum)'}</span>
</p>
<p class="select">
<span>{l s='Date of Birth'}</span>
<select id="days" name="days">
<option value="">-</option>
{foreach from=$days item=day}
<option value="{$day}" {if ($sl_day == $day)} selected="selected"{/if}>{$day}&nbsp;&nbsp;</option>
{/foreach}
</select>
{*
{l s='January'}
{l s='February'}
{l s='March'}
{l s='April'}
{l s='May'}
{l s='June'}
{l s='July'}
{l s='August'}
{l s='September'}
{l s='October'}
{l s='November'}
{l s='December'}
*}
<select id="months" name="months">
<option value="">-</option>
{foreach from=$months key=k item=month}
<option value="{$k}" {if ($sl_month == $k)} selected="selected"{/if}>{l s=$month}&nbsp;</option>
{/foreach}
</select>
<select id="years" name="years">
<option value="">-</option>
{foreach from=$years item=year}
<option value="{$year}" {if ($sl_year == $year)} selected="selected"{/if}>{$year}&nbsp;&nbsp;</option>
{/foreach}
</select>
</p>
{if $newsletter}
<p class="checkbox" >
<input type="checkbox" name="newsletter" id="newsletter" value="1" {if isset($smarty.post.newsletter) AND $smarty.post.newsletter == 1} checked="checked"{/if} autocomplete="off"/>
<label for="newsletter">{l s='Sign up for our newsletter!'}</label>
</p>
<p class="checkbox" >
<input type="checkbox"name="optin" id="optin" value="1" {if isset($smarty.post.optin) AND $smarty.post.optin == 1} checked="checked"{/if} autocomplete="off"/>
<label for="optin">{l s='Receive special offers from our partners!'}</label>
</p>
{/if}
</fieldset>
{if $b2b_enable}
<fieldset class="account_creation">
<h3>{l s='Your company information'}</h3>
<p class="text">
<label for="">{l s='Company'}</label>
<input type="text" class="text" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{/if}" />
</p>
<p class="text">
<label for="siret">{l s='SIRET'}</label>
<input type="text" class="text" id="siret" name="siret" value="{if isset($smarty.post.siret)}{$smarty.post.siret}{/if}" />
</p>
<p class="text">
<label for="ape">{l s='APE'}</label>
<input type="text" class="text" id="ape" name="ape" value="{if isset($smarty.post.ape)}{$smarty.post.ape}{/if}" />
</p>
<p class="text">
<label for="website">{l s='Website'}</label>
<input type="text" class="text" id="website" name="website" value="{if isset($smarty.post.website)}{$smarty.post.website}{/if}" />
</p>
</fieldset>
{/if}
{if isset($PS_REGISTRATION_PROCESS_TYPE) && $PS_REGISTRATION_PROCESS_TYPE}
<fieldset class="account_creation">
<h3>{l s='Your address'}</h3>
{foreach from=$dlv_all_fields item=field_name}
{if $field_name eq "company"}
{if !$b2b_enable}
<p class="text">
<label for="company">{l s='Company'}</label>
<input type="text" class="text" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{/if}" />
</p>
{/if}
{elseif $field_name eq "vat_number"}
<div id="vat_number" style="display:none;">
<p class="text">
<label for="vat_number">{l s='VAT number'}</label>
<input type="text" class="text" name="vat_number" value="{if isset($smarty.post.vat_number)}{$smarty.post.vat_number}{/if}" />
</p>
</div>
{elseif $field_name eq "firstname"}
<p class="required text">
<label for="firstname">{l s='First name'} <sup>*</sup></label>
<input type="text" class="text" id="firstname" name="firstname" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{/if}" />
</p>
{elseif $field_name eq "lastname"}
<p class="required text">
<label for="lastname">{l s='Last name'} <sup>*</sup></label>
<input type="text" class="text" id="lastname" name="lastname" value="{if isset($smarty.post.lastname)}{$smarty.post.lastname}{/if}" />
</p>
{elseif $field_name eq "address1"}
<p class="required text">
<label for="address1">{l s='Address'} <sup>*</sup></label>
<input type="text" class="text" name="address1" id="address1" value="{if isset($smarty.post.address1)}{$smarty.post.address1}{/if}" />
<span class="inline-infos">{l s='Street address, P.O. Box, Company name, etc.'}</span>
</p>
{elseif $field_name eq "address2"}
<p class="text">
<label for="address2">{l s='Address (Line 2)'}</label>
<input type="text" class="text" name="address2" id="address2" value="{if isset($smarty.post.address2)}{$smarty.post.address2}{/if}" />
<span class="inline-infos">{l s='Apartment, suite, unit, building, floor, etc...'}</span>
</p>
{elseif $field_name eq "postcode"}
{assign var='postCodeExist' value=true}
<p class="required postcode text">
<label for="postcode">{l s='Zip / Postal Code'} <sup>*</sup></label>
<input type="text" class="text" name="postcode" id="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{/if}" onkeyup="$('#postcode').val($('#postcode').val().toUpperCase());" />
</p>
{elseif $field_name eq "city"}
<p class="required text">
<label for="city">{l s='City'} <sup>*</sup></label>
<input type="text" class="text" name="city" id="city" value="{if isset($smarty.post.city)}{$smarty.post.city}{/if}" />
</p>
<!--
if customer hasn't update his layout address, country has to be verified
but it's deprecated
-->
{elseif $field_name eq "Country:name" || $field_name eq "country"}
<p class="required select">
<label for="id_country">{l s='Country'} <sup>*</sup></label>
<select name="id_country" id="id_country">
<option value="">-</option>
{foreach from=$countries item=v}
<option value="{$v.id_country}"{if (isset($smarty.post.id_country) AND $smarty.post.id_country == $v.id_country) OR (!isset($smarty.post.id_country) && $sl_country == $v.id_country)} selected="selected"{/if}>{$v.name}</option>
{/foreach}
</select>
</p>
{elseif $field_name eq "State:name" || $field_name eq 'state'}
{assign var='stateExist' value=true}
<p class="required id_state select">
<label for="id_state">{l s='State'} <sup>*</sup></label>
<select name="id_state" id="id_state">
<option value="">-</option>
</select>
</p>
{/if}
{/foreach}
{if $postCodeExist eq false}
<p class="required postcode text hidden">
<label for="postcode">{l s='Zip / Postal Code'} <sup>*</sup></label>
<input type="text" class="text" name="postcode" id="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{/if}" onkeyup="$('#postcode').val($('#postcode').val().toUpperCase());" />
</p>
{/if}
{if $stateExist eq false}
<p class="required id_state select hidden">
<label for="id_state">{l s='State'} <sup>*</sup></label>
<select name="id_state" id="id_state">
<option value="">-</option>
</select>
</p>
{/if}
<p class="textarea">
<label for="other">{l s='Additional information'}</label>
<textarea name="other" id="other" cols="26" rows="3">{if isset($smarty.post.other)}{$smarty.post.other}{/if}</textarea>
</p>
{if isset($one_phone_at_least) && $one_phone_at_least}
<p class="inline-infos required">{l s='You must register at least one phone number.'}</p>
{/if}
<p class="text">
<label for="phone">{l s='Home phone'}</label>
<input type="text" class="text" name="phone" id="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}" />
</p>
<p class="{if isset($one_phone_at_least) && $one_phone_at_least}required {/if}text">
<label for="phone_mobile">{l s='Mobile phone'}{if isset($one_phone_at_least) && $one_phone_at_least} <sup>*</sup>{/if}</label>
<input type="text" class="text" name="phone_mobile" id="phone_mobile" value="{if isset($smarty.post.phone_mobile)}{$smarty.post.phone_mobile}{/if}" />
</p>
<p class="required text" id="address_alias">
<label for="alias">{l s='Assign an address alias for future reference.'} <sup>*</sup></label>
<input type="text" class="text" name="alias" id="alias" value="{if isset($smarty.post.alias)}{$smarty.post.alias}{else}{l s='My address'}{/if}" />
</p>
</fieldset>
<fieldset class="account_creation dni">
<h3>{l s='Tax identification'}</h3>
<p class="required text">
<label for="dni">{l s='Identification number'} <sup>*</sup></label>
<input type="text" class="text" name="dni" id="dni" value="{if isset($smarty.post.dni)}{$smarty.post.dni}{/if}" />
<span class="form_info">{l s='DNI / NIF / NIE'}</span>
</p>
</fieldset>
{/if}
{$HOOK_CREATE_ACCOUNT_FORM}
<p class="cart_navigation required submit">
<input type="hidden" name="email_create" value="1" />
<input type="hidden" name="is_new_customer" value="1" />
{if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back|escape:'htmlall':'UTF-8'}" />{/if}
<input type="submit" name="submitAccount" id="submitAccount" value="{l s='Register'}" class="exclusive" />
<span><sup>*</sup>{l s='Required field'}</span>
</p>
</form>
{/if}
+120
View File
@@ -0,0 +1,120 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{include file="$tpl_dir./breadcrumb.tpl"}
{include file="$tpl_dir./errors.tpl"}
{if isset($category)}
{if $category->id AND $category->active}
<h1>
{strip}
{$category->name|escape:'htmlall':'UTF-8'}
{if isset($categoryNameComplement)}
{$categoryNameComplement|escape:'htmlall':'UTF-8'}
{/if}
{/strip}
</h1>
<div class="resumecat category-product-count">
{include file="$tpl_dir./category-count.tpl"}
</div>
{if $scenes || $category->description || $category->id_image}
<div class="content_scene_cat">
{if $scenes}
<!-- Scenes -->
{include file="$tpl_dir./scenes.tpl" scenes=$scenes}
{else}
<!-- Category image -->
{if $category->id_image}
<div class="align_center">
<img src="{$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html'}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" />
</div>
{/if}
{/if}
{if $category->description}
<div class="cat_desc">
{if strlen($category->description) > 120}
<div id="category_description_short">{$description_short}</div>
<div id="category_description_full" style="display:none;">{$category->description}</div>
<a href="#" onclick="$('#category_description_short').hide(); $('#category_description_full').show(); $(this).hide(); return false;" class="lnk_more">{l s='More'}</a>
{else}
<div>{$category->description}</div>
{/if}
</div>
{/if}
</div>
{/if}
{if isset($subcategories)}
<!-- Subcategories -->
<div id="subcategories">
<h3>{l s='Subcategories'}</h3>
<ul class="inline_list">
{foreach from=$subcategories item=subcategory}
<li class="clearfix">
<a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}" class="img">
{if $subcategory.id_image}
<img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
{else}
<img src="{$img_cat_dir}default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
{/if}
</a>
<a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" class="cat_name">{$subcategory.name|escape:'htmlall':'UTF-8'}</a>
{if $subcategory.description}
<p class="cat_desc">{$subcategory.description}</p>
{/if}
</li>
{/foreach}
</ul>
<br class="clear"/>
</div>
{/if}
{if $products}
<div class="content_sortPagiBar">
{include file="$tpl_dir./pagination.tpl"}
<div class="sortPagiBar clearfix">
{include file="./product-sort.tpl"}
{include file="./product-compare.tpl"}
{include file="./nbr-product-page.tpl"}
</div>
</div>
{include file="./product-list.tpl" products=$products}
<div class="content_sortPagiBar">
<div class="sortPagiBar clearfix">
{include file="./product-sort.tpl" paginationId='bottom'}
{include file="./product-compare.tpl" paginationId='bottom'}
{include file="./nbr-product-page.tpl" paginationId='bottom'}
</div>
{include file="./pagination.tpl" paginationId='bottom'}
</div>
{/if}
{elseif $category->id}
<p class="warning">{l s='This category is currently unavailable.'}</p>
{/if}
{/if}
+132
View File
@@ -0,0 +1,132 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{capture name=path}{l s='Contact'}{/capture}
{include file="$tpl_dir./breadcrumb.tpl"}
<h1>{l s='Customer service'} - {if isset($customerThread) && $customerThread}{l s='Your reply'}{else}{l s='Contact us'}{/if}</h1>
{if isset($confirmation)}
<p>{l s='Your message has been successfully sent to our team.'}</p>
<ul class="footer_links">
<li><a href="{$base_dir}"><img class="icon" alt="" src="{$img_dir}icon/home.gif"/></a><a href="{$base_dir}">{l s='Home'}</a></li>
</ul>
{elseif isset($alreadySent)}
<p>{l s='Your message has already been sent.'}</p>
<ul class="footer_links">
<li><a href="{$base_dir}"><img class="icon" alt="" src="{$img_dir}icon/home.gif"/></a><a href="{$base_dir}">{l s='Home'}</a></li>
</ul>
{else}
<p class="bold">{l s='For questions about an order or for more information about our products'}.</p>
{include file="$tpl_dir./errors.tpl"}
<form action="{$request_uri|escape:'htmlall':'UTF-8'}" method="post" class="std" enctype="multipart/form-data">
<fieldset>
<h3>{l s='send a message'}</h3>
<p class="select">
<label for="id_contact">{l s='Subject Heading'}</label>
{if isset($customerThread.id_contact)}
{foreach from=$contacts item=contact}
{if $contact.id_contact == $customerThread.id_contact}
<input type="text" id="contact_name" name="contact_name" value="{$contact.name|escape:'htmlall':'UTF-8'}" readonly="readonly" />
<input type="hidden" name="id_contact" value="{$contact.id_contact}" />
{/if}
{/foreach}
</p>
{else}
<select id="id_contact" name="id_contact" onchange="showElemFromSelect('id_contact', 'desc_contact')">
<option value="0">{l s='-- Choose --'}</option>
{foreach from=$contacts item=contact}
<option value="{$contact.id_contact|intval}" {if isset($smarty.request.id_contact) && $smarty.request.id_contact == $contact.id_contact}selected="selected"{/if}>{$contact.name|escape:'htmlall':'UTF-8'}</option>
{/foreach}
</select>
</p>
<p id="desc_contact0" class="desc_contact">&nbsp;</p>
{foreach from=$contacts item=contact}
<p id="desc_contact{$contact.id_contact|intval}" class="desc_contact" style="display:none;">
{$contact.description|escape:'htmlall':'UTF-8'}
</p>
{/foreach}
{/if}
<p class="text">
<label for="email">{l s='Email address'}</label>
{if isset($customerThread.email)}
<input type="text" id="email" name="from" value="{$customerThread.email|escape:'htmlall':'UTF-8'}" readonly="readonly" />
{else}
<input type="text" id="email" name="from" value="{$email|escape:'htmlall':'UTF-8'}" />
{/if}
</p>
{if !$PS_CATALOG_MODE}
{if (!isset($customerThread.id_order) || $customerThread.id_order > 0)}
<p class="text select">
<label for="id_order">{l s='Order reference'}</label>
{if !isset($customerThread.id_order) && isset($isLogged) && $isLogged == 1}
<select name="id_order" >
<option value="0">{l s='-- Choose --'}</option>
{foreach from=$orderList item=order}
<option value="{$order.value|intval}" {if $order.selected|intval}selected="selected"{/if}>{$order.label|escape:'htmlall':'UTF-8'}</option>
{/foreach}
</select>
{elseif !isset($customerThread.id_order) && empty($isLogged)}
<input type="text" name="id_order" id="id_order" value="{if isset($customerThread.id_order) && $customerThread.id_order|intval > 0}{$customerThread.id_order|intval}{else}{if isset($smarty.post.id_order) && !empty($smarty.post.id_order)}{$smarty.post.id_order|intval}{/if}{/if}" />
{elseif $customerThread.id_order|intval > 0}
<input type="text" name="id_order" id="id_order" value="{$customerThread.id_order|intval}" readonly="readonly" />
{/if}
</p>
{/if}
{if isset($isLogged) && $isLogged}
<p class="text select">
<label for="id_product">{l s='Product'}</label>
{if !isset($customerThread.id_product)}
{foreach from=$orderedProductList key=id_order item=products name=products}
<select name="id_product" id="{$id_order}_order_products" class="product_select" style="width:300px;{if !$smarty.foreach.products.first} display:none; {/if}" {if !$smarty.foreach.products.first}disabled="disabled" {/if}>
<option value="0">{l s='-- Choose --'}</option>
{foreach from=$products item=product}
<option value="{$product.value|intval}">{$product.label|escape:'htmlall':'UTF-8'}</option>
{/foreach}
</select>
{/foreach}
{elseif $customerThread.id_product > 0}
<input type="text" name="id_product" id="id_product" value="{$customerThread.id_product|intval}" readonly="readonly" />
{/if}
</p>
{/if}
{/if}
{if $fileupload == 1}
<p class="text">
<label for="fileUpload">{l s='Attach File'}</label>
<input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
<input type="file" name="fileUpload" id="fileUpload" />
</p>
{/if}
<p class="textarea">
<label for="message">{l s='Message'}</label>
<textarea id="message" name="message" rows="15" cols="10">{if isset($message)}{$message|escape:'htmlall':'UTF-8'|stripslashes}{/if}</textarea>
</p>
<p class="submit">
<input type="submit" name="submitMessage" id="submitMessage" value="{l s='Send'}" class="button_large" />
</p>
</fieldset>
</form>
{/if}
+71
View File
@@ -0,0 +1,71 @@
#history #left_column {display:none}
#history #center_column{width:757px}
#history #center_column h1{margin-top:20px}
#history #center_column .title_block {
margin:20px 0;
padding:15px 20px;
background:#ccc
}
#history #center_column .title_block input {
position: relative;
top: -8px;
float:right;
}
.info-order {
margin-bottom:20px;
}
.info-order p {padding-bottom:10px}
.info-order p .icon {
position:relative;
top:2px;
left:0
}
#order-list {
margin-bottom:20px;
width:100%;
border:1px solid #999;
border-bottom:none
}
#order-list th {
padding:14px 12px;
color:#fff;
text-transform:uppercase;
text-shadow:0 1px 0 #000;
background:url(../img/bg_table_th.png) repeat-x 0 0 #999
}
#order-list tr.alternate_item {background-color: #f3f3f3}
#order-list td {
padding:12px;
border-right:1px solid #e9e9e9;
border-bottom:1px solid #e9e9e9;
font-weight:bold;
font-size:12px;
vertical-align:top
}
#order-list td .price, #order-detail-content tbody .price {
white-space: nowrap;
}
#order-list td.history_detail {border-right:none;}
#order-list .last_item td {border-bottom:1px solid #999}
.adresses_bloc {margin-bottom:20px}
.adresses_bloc .item {margin-right:60px}
.detail_step_by_step {width:100%}
.detail_step_by_step tr.last_item td {border-bottom:1px solid #999}
#order-detail-content table {width:100%}
#order-detail-content table .order_qte_input {display:none}
#order-detail-content table tr.totalprice td {border-bottom:1px solid #999}
#order-detail-content table tr:nth-child(even) {background:#f3f3f3;}
#sendOrderMessage {margin-bottom:20px}
#sendOrderMessage p {padding-bottom:10px}
#returnOrderMessage .textarea textarea,
#sendOrderMessage .textarea textarea {
width:100%;
border:1px solid #999
}
+94
View File
@@ -0,0 +1,94 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7 " lang="{$lang_iso}"> <![endif]-->
<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8 ie7" lang="{$lang_iso}"> <![endif]-->
<!--[if IE 8]><html class="no-js lt-ie9 ie8" lang="{$lang_iso}"> <![endif]-->
<!--[if gt IE 8]> <html class="no-js ie9" lang="{$lang_iso}"> <![endif]-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{$lang_iso}">
<head>
<title>{$meta_title|escape:'htmlall':'UTF-8'}</title>
{if isset($meta_description) AND $meta_description}
<meta name="description" content="{$meta_description|escape:html:'UTF-8'}" />
{/if}
{if isset($meta_keywords) AND $meta_keywords}
<meta name="keywords" content="{$meta_keywords|escape:html:'UTF-8'}" />
{/if}
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<meta http-equiv="content-language" content="{$meta_language}" />
<meta name="generator" content="PrestaShop" />
<meta name="robots" content="{if isset($nobots)}no{/if}index,{if isset($nofollow) && $nofollow}no{/if}follow" />
<link rel="icon" type="image/vnd.microsoft.icon" href="{$favicon_url}?{$img_update_time}" />
<link rel="shortcut icon" type="image/x-icon" href="{$favicon_url}?{$img_update_time}" />
<script type="text/javascript">
var baseDir = '{$content_dir|addslashes}';
var baseUri = '{$base_uri|addslashes}';
var static_token = '{$static_token|addslashes}';
var token = '{$token|addslashes}';
var priceDisplayPrecision = {$priceDisplayPrecision*$currency->decimals};
var priceDisplayMethod = {$priceDisplay};
var roundMode = {$roundMode};
</script>
{if isset($css_files)}
{foreach from=$css_files key=css_uri item=media}
<link href="{$css_uri}" rel="stylesheet" type="text/css" media="{$media}" />
{/foreach}
{/if}
{if isset($js_files)}
{foreach from=$js_files item=js_uri}
<script type="text/javascript" src="{$js_uri}"></script>
{/foreach}
{/if}
{$HOOK_HEADER}
</head>
<body {if isset($page_name)}id="{$page_name|escape:'htmlall':'UTF-8'}"{/if} class="{if isset($page_name)}{$page_name|escape:'htmlall':'UTF-8'}{/if}{if $hide_left_column} hide-left-column{/if}{if $hide_right_column} hide-right-column{/if}{if $content_only} content_only{/if}">
{if !$content_only}
{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" class="container_9 clearfix">
<!-- Header -->
<div id="header" class="grid_9 alpha omega">
<a id="header_logo" href="{$base_dir}" title="{$shop_name|escape:'htmlall':'UTF-8'}">
<img class="logo" src="{$logo_url}" alt="{$shop_name|escape:'htmlall':'UTF-8'}" {if $logo_image_width}width="{$logo_image_width}"{/if} {if $logo_image_height}height="{$logo_image_height}" {/if}/>
</a>
<div id="header_right" class="grid_9 omega">
{$HOOK_TOP}
</div>
</div>
<div id="columns" class="grid_9 alpha omega clearfix">
<!-- Left -->
<div id="left_column" class="column grid_2 alpha">
{$HOOK_LEFT_COLUMN}
</div>
<!-- Center -->
<div id="center_column" class=" grid_5">
{/if}
+876
View File
@@ -0,0 +1,876 @@
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
$(document).ready(function()
{
$('.cart_quantity_up').unbind('click').live('click', function(){upQuantity($(this).attr('id').replace('cart_quantity_up_', '')); return false;});
$('.cart_quantity_down').unbind('click').live('click', function(){downQuantity($(this).attr('id').replace('cart_quantity_down_', '')); return false;});
$('.cart_quantity_delete' ).unbind('click').live('click', function(){deleteProductFromSummary($(this).attr('id')); return false;});
$('.cart_quantity_input').typeWatch({highlight: true, wait: 600, captureLength: 0, callback: function(val) { updateQty(val, true, this.el);}});
$('.cart_address_delivery').live('change', function(){changeAddressDelivery($(this));});
cleanSelectAddressDelivery();
});
function cleanSelectAddressDelivery()
{
if (window.ajaxCart !== undefined)
{
//Removing "Ship to an other address" from the address delivery select option if there is not enought address
$.each($('.cart_address_delivery'), function(it, item)
{
var options = $(item).find('option');
var address_count = 0;
var ids = $(item).attr('id').split('_');
var id_product = ids[3];
var id_product_attribute = ids[4];
var id_address_delivery = ids[5];
$.each(options, function(i) {
if ($(options[i]).val() > 0
&& ($('#product_' + id_product + '_' + id_product_attribute + '_0_' + $(options[i]).val()).length == 0 // Check the address is not already used for a similare products
|| id_address_delivery == $(options[i]).val()
)
)
address_count++;
});
// Need at least two address to allow skipping products to multiple address
if (address_count < 2)
$($(item).find('option[value=-2]')).remove();
else if($($(item).find('option[value=-2]')).length == 0)
$(item).append($('<option value="-2">' + ShipToAnOtherAddress + '</option>'));
});
}
}
function changeAddressDelivery(obj)
{
var ids = obj.attr('id').split('_');
var id_product = ids[3];
var id_product_attribute = ids[4];
var old_id_address_delivery = ids[5];
var new_id_address_delivery = obj.val();
if (new_id_address_delivery == old_id_address_delivery)
return;
if (new_id_address_delivery > 0) // Change the delivery address
{
$.ajax({
type: 'POST',
headers: { "cache-control": "no-cache" },
url: baseUri + '?rand=' + new Date().getTime(),
async: true,
cache: false,
dataType: 'json',
data: 'controller=cart&ajax=true&changeAddressDelivery=1&summary=1&id_product=' + id_product
+ '&id_product_attribute='+id_product_attribute
+ '&old_id_address_delivery='+old_id_address_delivery
+ '&new_id_address_delivery='+new_id_address_delivery
+ '&token='+static_token
+ '&allow_refresh=1',
success: function(jsonData)
{
if (typeof(jsonData.hasErrors) != 'undefined' && jsonData.hasErrors)
{
alert(jsonData.error);
// Reset the old address
$('#select_address_delivery_' + id_product + '_' + id_product_attribute + '_' + old_id_address_delivery).val(old_id_address_delivery);
}
else
{
// The product exist
if ($('#product_' + id_product + '_' + id_product_attribute + '_0_' + new_id_address_delivery).length)
{
updateCartSummary(jsonData.summary);
if (window.ajaxCart != undefined)
ajaxCart.updateCart(jsonData);
updateCustomizedDatas(jsonData.customizedDatas);
updateHookShoppingCart(jsonData.HOOK_SHOPPING_CART);
updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA);
if (typeof(getCarrierListAndUpdate) !== 'undefined')
getCarrierListAndUpdate();
// @todo reverse the remove order
// This effect remove the current line, but it's better to remove the other one, and refresshing this one
$('#product_' + id_product + '_' + id_product_attribute + '_0_' + old_id_address_delivery).remove();
// @todo improve customization upgrading
$('.product_' + id_product + '_' + id_product_attribute + '_0_' + old_id_address_delivery).remove();
}
if (window.ajaxCart != undefined)
ajaxCart.updateCart(jsonData);
updateAddressId(id_product, id_product_attribute, old_id_address_delivery, new_id_address_delivery);
cleanSelectAddressDelivery();
}
}
});
}
else if (new_id_address_delivery == -1) // Adding a new address
window.location = $($('.address_add a')[0]).attr('href');
else if (new_id_address_delivery == -2) // Add a new line for this product
{
// This test is will not usefull in the future
if (old_id_address_delivery == 0)
{
alert(txtSelectAnAddressFirst);
return false;
}
// Get new address to deliver
var id_address_delivery = 0;
var options = $('#select_address_delivery_' + id_product + '_' + id_product_attribute + '_' + old_id_address_delivery + ' option');
$.each(options, function(i) {
// Check the address is not already used for a similare products
if ($(options[i]).val() > 0 && $(options[i]).val() !== old_id_address_delivery && $('#product_' + id_product + '_' + id_product_attribute + '_0_' + $(options[i]).val()).length == 0)
{
id_address_delivery = $(options[i]).val();
return false;
}
});
$.ajax({
type: 'POST',
headers: { "cache-control": "no-cache" },
url: baseUri + '?rand=' + new Date().getTime(),
async: true,
cache: false,
dataType: 'json',
context: obj,
data: 'controller=cart'
+ '&ajax=true&duplicate=true&summary=true'
+ '&id_product='+id_product
+ '&id_product_attribute='+id_product_attribute
+ '&id_address_delivery='+old_id_address_delivery
+ '&new_id_address_delivery='+id_address_delivery
+ '&token='+static_token
+ '&allow_refresh=1',
success: function(jsonData)
{
if (jsonData.error)
{
alert(jsonData.reason);
return;
}
var line = $('#product_' + id_product + '_' + id_product_attribute + '_0_' + old_id_address_delivery);
var new_line = line.clone();
updateAddressId(id_product, id_product_attribute, old_id_address_delivery, id_address_delivery, new_line);
line.after(new_line);
new_line.find('input[name=quantity_' + id_product + '_' + id_product_attribute + '_0_' + old_id_address_delivery + '_hidden]')
.val(1);
new_line.find('.cart_quantity_input')
.val(1);
$('#select_address_delivery_' + id_product + '_' + id_product_attribute + '_' + old_id_address_delivery).val(old_id_address_delivery);
$('#select_address_delivery_' + id_product + '_' + id_product_attribute + '_' + id_address_delivery).val(id_address_delivery);
cleanSelectAddressDelivery();
updateCartSummary(jsonData.summary);
if (window.ajaxCart !== undefined)
ajaxCart.updateCart(jsonData);
}
});
}
return true;
}
function updateAddressId(id_product, id_product_attribute, old_id_address_delivery, id_address_delivery, line)
{
if (typeof(line) == 'undefined' || line.length == 0)
line = $('#cart_summary tr[id^=product_' + id_product + '_' + id_product_attribute + '_0_], #cart_summary tr[id^=product_' + id_product + '_' + id_product_attribute + '_nocustom_]');
$('.product_customization_for_' + id_product + '_' + id_product_attribute + '_' + old_id_address_delivery).each(function(){
$(this).attr('id', $(this).attr('id').replace(/_\d+$/, '_' + id_address_delivery)).removeClass('product_customization_for_' + id_product + '_' + id_product_attribute + '_' + old_id_address_delivery + ' address_' + old_id_address_delivery).addClass('product_customization_for_' + id_product + '_' + id_product_attribute + '_' + id_address_delivery + ' address_' + id_address_delivery);
$(this).find('input[name^=quantity_]').each(function(){
if (typeof($(this).attr('name')) != 'undefined')
$(this).attr('name', $(this).attr('name').replace(/_\d+(_hidden|)$/, '_' + id_address_delivery));
});
$(this).find('a').each(function(){
if (typeof($(this).attr('href')) != 'undefined')
$(this).attr('href', $(this).attr('href').replace(/id_address_delivery=\d+/, 'id_address_delivery=' + id_address_delivery));
});
});
line.attr('id', line.attr('id').replace(/_\d+$/, '_' + id_address_delivery)).removeClass('address_' + old_id_address_delivery).addClass('address_' + id_address_delivery).find('span[id^=cart_quantity_custom_], span[id^=total_product_price_], input[name^=quantity_], .cart_quantity_down, .cart_quantity_up, .cart_quantity_delete').each(function(){
if (typeof($(this).attr('name')) != 'undefined')
$(this).attr('name', $(this).attr('name').replace(/_\d+(_hidden|)$/, '_' + id_address_delivery));
if (typeof($(this).attr('id')) != 'undefined')
$(this).attr('id', $(this).attr('id').replace(/_\d+$/, '_' + id_address_delivery));
if (typeof($(this).attr('href')) != 'undefined')
$(this).attr('href', $(this).attr('href').replace(/id_address_delivery=\d+/, 'id_address_delivery=' + id_address_delivery));
});
line.find('#select_address_delivery_' + id_product + '_' + id_product_attribute + '_' + old_id_address_delivery).attr('id', 'select_address_delivery_' + id_product + '_' + id_product_attribute + '_' + id_address_delivery);
if (window.ajaxCart !== undefined)
{
$('#cart_block_list dd, #cart_block_list dt').each(function(){
if (typeof($(this).attr('id')) != 'undefined')
$(this).attr('id', $(this).attr('id').replace(/_\d+$/, '_' + id_address_delivery));
});
}
}
function updateQty(val, cart, el)
{
var prefix = "";
if (typeof(cart) == 'undefined' || cart)
prefix = '#order-detail-content ';
else
prefix = '#fancybox-content ';
var id = $(el).attr('name');
var exp = new RegExp("^[0-9]+$");
if (exp.test(val) == true)
{
var hidden = $(prefix + 'input[name=' + id + '_hidden]').val();
var input = $(prefix + 'input[name=' + id + ']').val();
var QtyToUp = parseInt(input) - parseInt(hidden);
if (parseInt(QtyToUp) > 0)
upQuantity(id.replace('quantity_', ''), QtyToUp);
else if(parseInt(QtyToUp) < 0)
downQuantity(id.replace('quantity_', ''), QtyToUp);
}
else
$(prefix + 'input[name=' + id + ']').val($(prefix + 'input[name=' + id + '_hidden]').val());
if (typeof(getCarrierListAndUpdate) !== 'undefined')
getCarrierListAndUpdate();
}
function deleteProductFromSummary(id)
{
var customizationId = 0;
var productId = 0;
var productAttributeId = 0;
var id_address_delivery = 0;
var ids = 0;
ids = id.split('_');
productId = parseInt(ids[0]);
if (typeof(ids[1]) !== 'undefined')
productAttributeId = parseInt(ids[1]);
if (typeof(ids[2]) !== 'undefined' && ids[2] !== 'nocustom')
customizationId = parseInt(ids[2]);
if (typeof(ids[3]) !== 'undefined')
id_address_delivery = parseInt(ids[3]);
$.ajax({
type: 'POST',
headers: { "cache-control": "no-cache" },
url: baseUri + '?rand=' + new Date().getTime(),
async: true,
cache: false,
dataType: 'json',
data: 'controller=cart'
+ '&ajax=true&delete=true&summary=true'
+ '&id_product='+productId
+ '&ipa='+productAttributeId
+ '&id_address_delivery='+id_address_delivery
+ ((customizationId !== 0) ? '&id_customization=' + customizationId : '')
+ '&token=' + static_token
+ '&allow_refresh=1',
success: function(jsonData)
{
if (jsonData.hasError)
{
var errors = '';
for(var error in jsonData.errors)
//IE6 bug fix
if (error !== 'indexOf')
errors += jsonData.errors[error] + "\n";
}
else
{
if (jsonData.refresh)
location.reload();
if (parseInt(jsonData.summary.products.length) == 0)
{
if (typeof(orderProcess) == 'undefined' || orderProcess !== 'order-opc')
document.location.href = document.location.href; // redirection
else
{
$('#center_column').children().each(function() {
if ($(this).attr('id') !== 'emptyCartWarning' && $(this).attr('class') !== 'breadcrumb' && $(this).attr('id') !== 'cart_title')
{
$(this).fadeOut('slow', function () {
$(this).remove();
});
}
});
$('#summary_products_label').remove();
$('#emptyCartWarning').fadeIn('slow');
}
}
else
{
$('#product_' + id).fadeOut('slow', function() {
$(this).remove();
cleanSelectAddressDelivery();
if (!customizationId)
refreshOddRow();
});
var exist = false;
for (i=0;i<jsonData.summary.products.length;i++)
{
if (jsonData.summary.products[i].id_product == productId
&& jsonData.summary.products[i].id_product_attribute == productAttributeId
&& jsonData.summary.products[i].id_address_delivery == id_address_delivery
&& (parseInt(jsonData.summary.products[i].customization_quantity) > 0))
exist = true;
}
// if all customization removed => delete product line
if (!exist && customizationId)
$('#product_' + productId + '_' + productAttributeId + '_0_' + id_address_delivery).fadeOut('slow', function() {
$(this).remove();
var line = $('#product_' + productId + '_' + productAttributeId + '_nocustom_' + id_address_delivery);
if (line.length > 0)
{
line.find('input[name^=quantity_], .cart_quantity_down, .cart_quantity_up, .cart_quantity_delete').each(function(){
if (typeof($(this).attr('name')) != 'undefined')
$(this).attr('name', $(this).attr('name').replace(/nocustom/, '0'));
if (typeof($(this).attr('id')) != 'undefined')
$(this).attr('id', $(this).attr('id').replace(/nocustom/, '0'));
});
line.find('span[id^=total_product_price_]').each(function(){
$(this).attr('id', $(this).attr('id').replace(/_nocustom/, ''));
});
line.attr('id', line.attr('id').replace(/nocustom/, '0'));
}
refreshOddRow();
});
}
updateCartSummary(jsonData.summary);
if (window.ajaxCart != undefined)
ajaxCart.updateCart(jsonData);
updateCustomizedDatas(jsonData.customizedDatas);
updateHookShoppingCart(jsonData.HOOK_SHOPPING_CART);
updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA);
if (typeof(getCarrierListAndUpdate) !== 'undefined' && jsonData.summary.products.length > 0)
getCarrierListAndUpdate();
if (typeof(updatePaymentMethodsDisplay) !== 'undefined')
updatePaymentMethodsDisplay();
}
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
if (textStatus !== 'abort')
alert("TECHNICAL ERROR: unable to save update quantity \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
}
});
}
function refreshOddRow()
{
var odd_class = 'odd';
var even_class = 'even';
$.each($('.cart_item'), function(i, it)
{
if (i == 0) // First item
{
if ($(this).hasClass('even'))
{
odd_class = 'even';
even_class = 'odd';
}
$(this).addClass('first_item');
}
if(i % 2)
$(this).removeClass(odd_class).addClass(even_class);
else
$(this).removeClass(even_class).addClass(odd_class);
});
$('.cart_item:last-child, .customization:last-child').addClass('last_item');
}
function upQuantity(id, qty)
{
if (typeof(qty) == 'undefined' || !qty)
qty = 1;
var customizationId = 0;
var productId = 0;
var productAttributeId = 0;
var id_address_delivery = 0;
var ids = 0;
ids = id.split('_');
productId = parseInt(ids[0]);
if (typeof(ids[1]) !== 'undefined')
productAttributeId = parseInt(ids[1]);
if (typeof(ids[2]) !== 'undefined' && ids[2] !== 'nocustom')
customizationId = parseInt(ids[2]);
if (typeof(ids[3]) !== 'undefined')
id_address_delivery = parseInt(ids[3]);
$.ajax({
type: 'POST',
headers: { "cache-control": "no-cache" },
url: baseUri + '?rand=' + new Date().getTime(),
async: true,
cache: false,
dataType: 'json',
data: 'controller=cart'
+ '&ajax=true'
+ '&add=true'
+ '&getproductprice=true'
+ '&summary=true'
+ '&id_product=' + productId
+ '&ipa=' + productAttributeId
+ '&id_address_delivery=' + id_address_delivery
+ ((customizationId !== 0) ? '&id_customization=' + customizationId : '')
+ '&qty=' + qty
+ '&token=' + static_token
+ '&allow_refresh=1',
success: function(jsonData)
{
if (jsonData.hasError)
{
var errors = '';
for(var error in jsonData.errors)
//IE6 bug fix
if(error !== 'indexOf')
errors += $('<div />').html(jsonData.errors[error]).text() + "\n";
alert(errors);
$('input[name=quantity_'+ id +']').val($('input[name=quantity_'+ id +'_hidden]').val());
}
else
{
if (jsonData.refresh)
location.reload();
updateCartSummary(jsonData.summary);
if (window.ajaxCart != undefined)
ajaxCart.updateCart(jsonData);
if (customizationId !== 0)
updateCustomizedDatas(jsonData.customizedDatas);
updateHookShoppingCart(jsonData.HOOK_SHOPPING_CART);
updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA);
if (typeof(getCarrierListAndUpdate) !== 'undefined')
getCarrierListAndUpdate();
if (typeof(updatePaymentMethodsDisplay) !== 'undefined')
updatePaymentMethodsDisplay();
}
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
if (textStatus !== 'abort')
alert("TECHNICAL ERROR: unable to save update quantity \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
}
});
}
function downQuantity(id, qty)
{
var val = $('input[name=quantity_' + id + ']').val();
var newVal = val;
if(typeof(qty) == 'undefined' || !qty)
{
qty = 1;
newVal = val - 1;
}
else if (qty < 0)
qty = -qty;
var customizationId = 0;
var productId = 0;
var productAttributeId = 0;
var id_address_delivery = 0;
var ids = 0;
ids = id.split('_');
productId = parseInt(ids[0]);
if (typeof(ids[1]) !== 'undefined')
productAttributeId = parseInt(ids[1]);
if (typeof(ids[2]) !== 'undefined' && ids[2] !== 'nocustom')
customizationId = parseInt(ids[2]);
if (typeof(ids[3]) !== 'undefined')
id_address_delivery = parseInt(ids[3]);
if (newVal > 0 || $('#product_' + id + '_gift').length)
{
$.ajax({
type: 'POST',
headers: { "cache-control": "no-cache" },
url: baseUri + '?rand=' + new Date().getTime(),
async: true,
cache: false,
dataType: 'json',
data: 'controller=cart'
+ '&ajax=true'
+ '&add=true'
+ '&getproductprice=true'
+ '&summary=true'
+ '&id_product='+productId
+ '&ipa='+productAttributeId
+ '&id_address_delivery='+id_address_delivery
+ '&op=down'
+ ((customizationId !== 0) ? '&id_customization='+customizationId : '')
+ '&qty='+qty
+ '&token='+static_token
+ '&allow_refresh=1',
success: function(jsonData)
{
if (jsonData.hasError)
{
var errors = '';
for(var error in jsonData.errors)
//IE6 bug fix
if(error !== 'indexOf')
errors += $('<div />').html(jsonData.errors[error]).text() + "\n";
alert(errors);
$('input[name=quantity_' + id + ']').val($('input[name=quantity_' + id + '_hidden]').val());
}
else
{
if (jsonData.refresh)
location.reload();
updateCartSummary(jsonData.summary);
if (window.ajaxCart !== undefined)
ajaxCart.updateCart(jsonData);
if (customizationId !== 0)
updateCustomizedDatas(jsonData.customizedDatas);
updateHookShoppingCart(jsonData.HOOK_SHOPPING_CART);
updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA);
if (newVal == 0)
$('#product_' + id).hide();
if (typeof(getCarrierListAndUpdate) !== 'undefined')
getCarrierListAndUpdate();
if (typeof(updatePaymentMethodsDisplay) !== 'undefined')
updatePaymentMethodsDisplay();
}
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
if (textStatus !== 'abort')
alert("TECHNICAL ERROR: unable to save update quantity \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
}
});
}
else
{
deleteProductFromSummary(id);
}
}
function updateCartSummary(json)
{
var i;
var nbrProducts = 0;
var product_list = new Array();
if (typeof json == 'undefined')
return;
$('div.error').fadeOut();
for (i=0;i<json.products.length;i++)
product_list[json.products[i].id_product + '_' + json.products[i].id_product_attribute + '_' + json.products[i].id_address_delivery] = json.products[i];
if (!$('.multishipping-cart:visible').length)
{
for (i=0;i<json.gift_products.length;i++)
if (typeof(product_list[json.gift_products[i].id_product + '_' + json.gift_products[i].id_product_attribute + '_' + json.gift_products[i].id_address_delivery]) !== 'undefined')
product_list[json.gift_products[i].id_product + '_' + json.gift_products[i].id_product_attribute + '_' + json.gift_products[i].id_address_delivery].quantity -= json.gift_products[i].cart_quantity;
}
else
for (i=0;i<json.gift_products.length;i++)
if (typeof(product_list[json.gift_products[i].id_product + '_' + json.gift_products[i].id_product_attribute + '_' + json.gift_products[i].id_address_delivery]) == 'undefined')
product_list[json.gift_products[i].id_product + '_' + json.gift_products[i].id_product_attribute + '_' + json.gift_products[i].id_address_delivery] = json.gift_products[i];
for (i in product_list)
{
// if reduction, we need to show it in the cart by showing the initial price above the current one
var reduction = product_list[i].reduction_applies;
var initial_price_text = '';
initial_price = '';
if (typeof(product_list[i].price_without_quantity_discount) !== 'undefined')
initial_price = formatCurrency(product_list[i].price_without_quantity_discount, currencyFormat, currencySign, currencyBlank);
var current_price = '';
if (priceDisplayMethod !== 0)
current_price = formatCurrency(product_list[i].price, currencyFormat, currencySign, currencyBlank);
else
current_price = formatCurrency(product_list[i].price_wt, currencyFormat, currencySign, currencyBlank);
if (reduction && typeof(initial_price) !== 'undefined')
if (initial_price !== '' && product_list[i].price_without_quantity_discount > product_list[i].price)
initial_price_text = '<span style="text-decoration:line-through;">' + initial_price + '</span><br />';
var key_for_blockcart = product_list[i].id_product + '_' + product_list[i].id_product_attribute + '_' + product_list[i].id_address_delivery;
var key_for_blockcart_nocustom = product_list[i].id_product + '_' + product_list[i].id_product_attribute + '_' + ((product_list[i].id_customization && product_list[i].quantity_without_customization != product_list[i].quantity)? 'nocustom' : '0') + '_' + product_list[i].id_address_delivery;
if (priceDisplayMethod !== 0)
{
$('#product_price_' + key_for_blockcart).html(initial_price_text + current_price);
if (typeof(product_list[i].customizationQuantityTotal) !== 'undefined' && product_list[i].customizationQuantityTotal > 0)
$('#total_product_price_' + key_for_blockcart).html(formatCurrency(product_list[i].total_customization, currencyFormat, currencySign, currencyBlank));
else
$('#total_product_price_' + key_for_blockcart).html(formatCurrency(product_list[i].total, currencyFormat, currencySign, currencyBlank));
if (product_list[i].quantity_without_customization != product_list[i].quantity)
$('#total_product_price_' + key_for_blockcart_nocustom).html(formatCurrency(product_list[i].total, currencyFormat, currencySign, currencyBlank));
}
else
{
$('#product_price_' + key_for_blockcart).html(initial_price_text + current_price);
if (typeof(product_list[i].customizationQuantityTotal) !== 'undefined' && product_list[i].customizationQuantityTotal > 0)
$('#total_product_price_' + key_for_blockcart).html(formatCurrency(product_list[i].total_customization_wt, currencyFormat, currencySign, currencyBlank));
else
$('#total_product_price_' + key_for_blockcart).html(formatCurrency(product_list[i].total_wt, currencyFormat, currencySign, currencyBlank));
if (product_list[i].quantity_without_customization != product_list[i].quantity)
$('#total_product_price_' + key_for_blockcart_nocustom).html(formatCurrency(product_list[i].total_wt, currencyFormat, currencySign, currencyBlank));
}
$('input[name=quantity_' + key_for_blockcart_nocustom + ']').val(product_list[i].id_customization? product_list[i].quantity_without_customization : product_list[i].cart_quantity);
$('input[name=quantity_' + key_for_blockcart_nocustom + '_hidden]').val(product_list[i].id_customization? product_list[i].quantity_without_customization : product_list[i].cart_quantity);
if (typeof(product_list[i].customizationQuantityTotal) !== 'undefined' && product_list[i].customizationQuantityTotal > 0)
$('#cart_quantity_custom_' + key_for_blockcart).html(product_list[i].customizationQuantityTotal);
nbrProducts += parseInt(product_list[i].quantity);
}
// Update discounts
if (json.discounts.length == 0)
{
$('.cart_discount').each(function(){$(this).remove();});
$('.cart_total_voucher').remove();
}
else
{
if ($('.cart_discount').length == 0)
location.reload();
if (priceDisplayMethod !== 0)
$('#total_discount').html('-' + formatCurrency(json.total_discounts_tax_exc, currencyFormat, currencySign, currencyBlank));
else
$('#total_discount').html('-' + formatCurrency(json.total_discounts, currencyFormat, currencySign, currencyBlank));
$('.cart_discount').each(function(){
var idElmt = $(this).attr('id').replace('cart_discount_','');
var toDelete = true;
for (i=0;i<json.discounts.length;i++)
if (json.discounts[i].id_discount == idElmt)
{
if (json.discounts[i].value_real !== '!')
{
if (priceDisplayMethod !== 0)
$('#cart_discount_' + idElmt + ' td.cart_discount_price span.price-discount').html(formatCurrency(json.discounts[i].value_tax_exc * -1, currencyFormat, currencySign, currencyBlank));
else
$('#cart_discount_' + idElmt + ' td.cart_discount_price span.price-discount').html(formatCurrency(json.discounts[i].value_real * -1, currencyFormat, currencySign, currencyBlank));
}
toDelete = false;
}
if (toDelete)
$('#cart_discount_' + idElmt + ', #cart_total_voucher').fadeTo('fast', 0, function(){ $(this).remove(); });
});
}
// Block cart
$('#cart_block_shipping_cost').show();
$('#cart_block_shipping_cost').next().show();
if (json.total_shipping > 0)
{
if (priceDisplayMethod !== 0)
{
$('#cart_block_shipping_cost').html(formatCurrency(json.total_shipping_tax_exc, currencyFormat, currencySign, currencyBlank));
$('#cart_block_wrapping_cost').html(formatCurrency(json.total_wrapping_tax_exc, currencyFormat, currencySign, currencyBlank));
$('#cart_block_total').html(formatCurrency(json.total_price_without_tax, currencyFormat, currencySign, currencyBlank));
}
else
{
$('#cart_block_shipping_cost').html(formatCurrency(json.total_shipping, currencyFormat, currencySign, currencyBlank));
$('#cart_block_wrapping_cost').html(formatCurrency(json.total_wrapping, currencyFormat, currencySign, currencyBlank));
$('#cart_block_total').html(formatCurrency(json.total_price, currencyFormat, currencySign, currencyBlank));
}
}
else
{
if (json.carrier.id == null)
{
$('#cart_block_shipping_cost').hide();
$('#cart_block_shipping_cost').next().hide();
}
}
$('#cart_block_tax_cost').html(formatCurrency(json.total_tax, currencyFormat, currencySign, currencyBlank));
$('.ajax_cart_quantity').html(nbrProducts);
// Cart summary
$('#summary_products_quantity').html(nbrProducts + ' ' + (nbrProducts > 1 ? txtProducts : txtProduct));
if (priceDisplayMethod !== 0)
$('#total_product').html(formatCurrency(json.total_products, currencyFormat, currencySign, currencyBlank));
else
$('#total_product').html(formatCurrency(json.total_products_wt, currencyFormat, currencySign, currencyBlank));
$('#total_price').html(formatCurrency(json.total_price, currencyFormat, currencySign, currencyBlank));
$('#total_price_without_tax').html(formatCurrency(json.total_price_without_tax, currencyFormat, currencySign, currencyBlank));
$('#total_tax').html(formatCurrency(json.total_tax, currencyFormat, currencySign, currencyBlank));
$('.cart_total_delivery').show();
if (json.total_shipping > 0)
{
if (priceDisplayMethod !== 0)
$('#total_shipping').html(formatCurrency(json.total_shipping_tax_exc, currencyFormat, currencySign, currencyBlank));
else
$('#total_shipping').html(formatCurrency(json.total_shipping, currencyFormat, currencySign, currencyBlank));
}
else
{
if (json.carrier.id != null)
$('#total_shipping').html(freeShippingTranslation);
else
$('.cart_total_delivery').hide();
}
if (json.free_ship > 0 && !json.is_virtual_cart)
{
$('.cart_free_shipping').fadeIn();
$('#free_shipping').html(formatCurrency(json.free_ship, currencyFormat, currencySign, currencyBlank));
}
else
$('.cart_free_shipping').hide();
if (json.total_wrapping > 0)
{
$('#total_wrapping').html(formatCurrency(json.total_wrapping, currencyFormat, currencySign, currencyBlank));
$('#total_wrapping').parent().show();
}
else
{
$('#total_wrapping').html(formatCurrency(json.total_wrapping, currencyFormat, currencySign, currencyBlank));
$('#total_wrapping').parent().hide();
}
}
function updateCustomizedDatas(json)
{
for(var i in json)
for(var j in json[i])
for(var k in json[i][j])
for(var l in json[i][j][k])
{
var quantity = json[i][j][k][l]['quantity'];
$('input[name=quantity_' + i + '_' + j + '_' + l + '_' + k + '_hidden]').val(quantity);
$('input[name=quantity_' + i + '_' + j + '_' + l + '_' + k + ']').val(quantity);
}
}
function updateHookShoppingCart(html)
{
$('#HOOK_SHOPPING_CART').html(html);
}
function updateHookShoppingCartExtra(html)
{
$('#HOOK_SHOPPING_CART_EXTRA').html(html);
}
function refreshDeliveryOptions()
{
$.each($('.delivery_option_radio'), function() {
if ($(this).prop('checked'))
{
if ($(this).parent().find('.delivery_option_carrier.not-displayable').length == 0)
$(this).parent().find('.delivery_option_carrier').show();
var carrier_id_list = $(this).val().split(',');
carrier_id_list.pop();
var it = this;
$(carrier_id_list).each(function() {
$(it).parent().find('input[value="' + this.toString() + '"]').change();
});
}
else
$(this).parent().find('.delivery_option_carrier').hide();
});
}
$(document).ready(function() {
refreshDeliveryOptions();
$('.delivery_option_radio').live('change', function() {
refreshDeliveryOptions();
});
$('#allow_seperated_package').live('click', function() {
$.ajax({
type: 'POST',
headers: { "cache-control": "no-cache" },
url: baseUri + '?rand=' + new Date().getTime(),
async: true,
cache: false,
data: 'controller=cart&ajax=true&allowSeperatedPackage=true&value='
+ ($(this).prop('checked') ? '1' : '0')
+ '&token='+static_token
+ '&allow_refresh=1',
success: function(jsonData)
{
if (typeof(getCarrierListAndUpdate) !== 'undefined')
getCarrierListAndUpdate();
}
});
});
$('#gift').checkboxChange(function() { $('#gift_div').show('slow'); }, function() { $('#gift_div').hide('slow'); });
$('#enable-multishipping').checkboxChange(
function() {
$('.standard-checkout').hide(0);
$('.multishipping-checkout').show(0);
},
function() {
$('.standard-checkout').show(0);
$('.multishipping-checkout').hide(0);
}
);
});
function updateExtraCarrier(id_delivery_option, id_address)
{
var url = "";
if(typeof(orderOpcUrl) !== 'undefined')
url = orderOpcUrl;
else
url = orderUrl;
$.ajax({
type: 'POST',
headers: { "cache-control": "no-cache" },
url: url + '?rand=' + new Date().getTime(),
async: true,
cache: false,
dataType : "json",
data: 'ajax=true'
+ '&method=updateExtraCarrier'
+ '&id_address='+id_address
+ '&id_delivery_option='+id_delivery_option
+ '&token='+static_token
+ '&allow_refresh=1',
success: function(jsonData)
{
$('#HOOK_EXTRACARRIER_' + id_address).html(jsonData['content']);
}
});
}
+741
View File
@@ -0,0 +1,741 @@
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
//global variables
var combinations = [];
var selectedCombination = [];
var globalQuantity = 0;
var colors = [];
//check if a function exists
function function_exists(function_name)
{
if (typeof function_name == 'string')
return (typeof window[function_name] == 'function');
return (function_name instanceof Function);
}
//execute oosHook js code
function oosHookJsCode()
{
for (var i = 0; i < oosHookJsCodeFunctions.length; i++)
{
if (function_exists(oosHookJsCodeFunctions[i]))
setTimeout(oosHookJsCodeFunctions[i] + '()', 0);
}
}
//add a combination of attributes in the global JS sytem
function addCombination(idCombination, arrayOfIdAttributes, quantity, price, ecotax, id_image, reference, unit_price, minimal_quantity, available_date, combination_specific_price)
{
globalQuantity += quantity;
var combination = [];
combination['idCombination'] = idCombination;
combination['quantity'] = quantity;
combination['idsAttributes'] = arrayOfIdAttributes;
combination['price'] = price;
combination['ecotax'] = ecotax;
combination['image'] = id_image;
combination['reference'] = reference;
combination['unit_price'] = unit_price;
combination['minimal_quantity'] = minimal_quantity;
combination['available_date'] = [];
combination['available_date'] = available_date;
combination['specific_price'] = [];
combination['specific_price'] = combination_specific_price;
combinations.push(combination);
}
// search the combinations' case of attributes and update displaying of availability, prices, ecotax, and image
function findCombination(firstTime)
{
$('#minimal_quantity_wanted_p').fadeOut();
$('#quantity_wanted').val(1);
//create a temporary 'choice' array containing the choices of the customer
var choice = [];
$('#attributes select, #attributes input[type=hidden], #attributes input[type=radio]:checked').each(function(){
choice.push($(this).val());
});
//testing every combination to find the conbination's attributes' case of the user
for (var combination = 0; combination < combinations.length; ++combination)
{
//verify if this combinaison is the same that the user's choice
var combinationMatchForm = true;
$.each(combinations[combination]['idsAttributes'], function(key, value)
{
if (!in_array(value, choice))
combinationMatchForm = false;
});
if (combinationMatchForm)
{
if (combinations[combination]['minimal_quantity'] > 1)
{
$('#minimal_quantity_label').html(combinations[combination]['minimal_quantity']);
$('#minimal_quantity_wanted_p').fadeIn();
$('#quantity_wanted').val(combinations[combination]['minimal_quantity']);
$('#quantity_wanted').bind('keyup', function() {checkMinimalQuantity(combinations[combination]['minimal_quantity']);});
}
//combination of the user has been found in our specifications of combinations (created in back office)
selectedCombination['unavailable'] = false;
selectedCombination['reference'] = combinations[combination]['reference'];
$('#idCombination').val(combinations[combination]['idCombination']);
//get the data of product with these attributes
quantityAvailable = combinations[combination]['quantity'];
selectedCombination['price'] = combinations[combination]['price'];
selectedCombination['unit_price'] = combinations[combination]['unit_price'];
selectedCombination['specific_price'] = combinations[combination]['specific_price'];
if (combinations[combination]['ecotax'])
selectedCombination['ecotax'] = combinations[combination]['ecotax'];
else
selectedCombination['ecotax'] = default_eco_tax;
//show the large image in relation to the selected combination
if (combinations[combination]['image'] && combinations[combination]['image'] != -1)
displayImage($('#thumb_' + combinations[combination]['image']).parent());
//show discounts values according to the selected combination
if (combinations[combination]['idCombination'] && combinations[combination]['idCombination'] > 0)
displayDiscounts(combinations[combination]['idCombination']);
//get available_date for combination product
selectedCombination['available_date'] = combinations[combination]['available_date'];
//update the display
updateDisplay();
if(typeof(firstTime) != 'undefined' && firstTime)
refreshProductImages(0);
else
refreshProductImages(combinations[combination]['idCombination']);
//leave the function because combination has been found
return;
}
}
//this combination doesn't exist (not created in back office)
selectedCombination['unavailable'] = true;
if (typeof(selectedCombination['available_date']) != 'undefined')
delete selectedCombination['available_date'];
updateDisplay();
}
//update display of the availability of the product AND the prices of the product
function updateDisplay()
{
var productPriceDisplay = productPrice;
var productPriceWithoutReductionDisplay = productPriceWithoutReduction;
if (!selectedCombination['unavailable'] && quantityAvailable > 0 && productAvailableForOrder == 1)
{
//show the choice of quantities
$('#quantity_wanted_p:hidden').show('slow');
//show the "add to cart" button ONLY if it was hidden
$('#add_to_cart:hidden').fadeIn(600);
//hide the hook out of stock
$('#oosHook').hide();
$('#availability_date').fadeOut();
//availability value management
if (availableNowValue != '')
{
//update the availability statut of the product
$('#availability_value').removeClass('warning_inline');
$('#availability_value').text(availableNowValue);
if(stock_management == 1)
$('#availability_statut:hidden').show();
}
else
$('#availability_statut:visible').hide();
//'last quantities' message management
if (!allowBuyWhenOutOfStock)
{
if (quantityAvailable <= maxQuantityToAllowDisplayOfLastQuantityMessage)
$('#last_quantities').show('slow');
else
$('#last_quantities').hide('slow');
}
if (quantitiesDisplayAllowed)
{
$('#pQuantityAvailable:hidden').show('slow');
$('#quantityAvailable').text(quantityAvailable);
if (quantityAvailable < 2) // we have 1 or less product in stock and need to show "item" instead of "items"
{
$('#quantityAvailableTxt').show();
$('#quantityAvailableTxtMultiple').hide();
}
else
{
$('#quantityAvailableTxt').hide();
$('#quantityAvailableTxtMultiple').show();
}
}
}
else
{
//show the hook out of stock
if (productAvailableForOrder == 1)
{
$('#oosHook').show();
if ($('#oosHook').length > 0 && function_exists('oosHookJsCode'))
oosHookJsCode();
}
//hide 'last quantities' message if it was previously visible
$('#last_quantities:visible').hide('slow');
//hide the quantity of pieces if it was previously visible
$('#pQuantityAvailable:visible').hide('slow');
//hide the choice of quantities
if (!allowBuyWhenOutOfStock)
$('#quantity_wanted_p:visible').hide('slow');
//display that the product is unavailable with theses attributes
if (!selectedCombination['unavailable'])
$('#availability_value').text(doesntExistNoMore + (globalQuantity > 0 ? ' ' + doesntExistNoMoreBut : '')).addClass('warning_inline');
else
{
$('#availability_value').text(doesntExist).addClass('warning_inline');
$('#oosHook').hide();
}
if(stock_management == 1 && !allowBuyWhenOutOfStock)
$('#availability_statut:hidden').show();
if (typeof(selectedCombination['available_date']) != 'undefined' && selectedCombination['available_date']['date'].length != 0)
{
var available_date = selectedCombination['available_date']['date'];
var tab_date = available_date.split('-');
var time_available = new Date(tab_date[0], tab_date[1], tab_date[2]);
time_available.setMonth(time_available.getMonth()-1);
var now = new Date();
if (now.getTime() < time_available.getTime() && $('#availability_date_value').text() != selectedCombination['available_date']['date_formatted'])
{
$('#availability_date').fadeOut('normal', function(){
$('#availability_date_value').text(selectedCombination['available_date']['date_formatted']);
$(this).fadeIn();
});
}
else if(now.getTime() < time_available.getTime())
$('#availability_date').fadeIn();
}
else
$('#availability_date').fadeOut();
//show the 'add to cart' button ONLY IF it's possible to buy when out of stock AND if it was previously invisible
if (allowBuyWhenOutOfStock && !selectedCombination['unavailable'] && productAvailableForOrder == 1)
{
$('#add_to_cart:hidden').fadeIn(600);
if (availableLaterValue != '')
{
$('#availability_value').text(availableLaterValue);
if(stock_management == 1)
$('#availability_statut:hidden').show('slow');
}
else
$('#availability_statut:visible').hide('slow');
}
else
{
$('#add_to_cart:visible').fadeOut(600);
if(stock_management == 1)
$('#availability_statut:hidden').show('slow');
}
if (productAvailableForOrder == 0)
$('#availability_statut:visible').hide();
}
if (selectedCombination['reference'] || productReference)
{
if (selectedCombination['reference'])
$('#product_reference span').text(selectedCombination['reference']);
else if (productReference)
$('#product_reference span').text(productReference);
$('#product_reference:hidden').show('slow');
}
else
$('#product_reference:visible').hide('slow');
//update display of the the prices in relation to tax, discount, ecotax, and currency criteria
if (!selectedCombination['unavailable'] && productShowPrice == 1)
{
var priceTaxExclWithoutGroupReduction = '';
// retrieve price without group_reduction in order to compute the group reduction after
// the specific price discount (done in the JS in order to keep backward compatibility)
priceTaxExclWithoutGroupReduction = ps_round(productPriceTaxExcluded, 6) * (1 / group_reduction);
var tax = (taxRate / 100) + 1;
var taxExclPrice = priceTaxExclWithoutGroupReduction + (selectedCombination['price'] * currencyRate);
if (selectedCombination.specific_price && selectedCombination.specific_price['id_product_attribute'])
{
if (selectedCombination.specific_price['price'] && selectedCombination.specific_price['price'] >=0)
var taxExclPrice = (specific_currency ? selectedCombination.specific_price['price'] : selectedCombination.specific_price['price'] * currencyRate);
else
var taxExclPrice = productBasePriceTaxExcluded * currencyRate + (selectedCombination['price'] * currencyRate);
}
else if (product_specific_price.price && product_specific_price.price >= 0)
var taxExclPrice = (specific_currency ? product_specific_price.price : product_specific_price.price * currencyRate) + (selectedCombination['price'] * currencyRate);
if (!displayPrice && !noTaxForThisProduct)
productPriceDisplay = ps_round(taxExclPrice * tax, 2); // Need to be global => no var
else
productPriceDisplay = ps_round(taxExclPrice, 2); // Need to be global => no var
productPriceWithoutReductionDisplay = productPriceDisplay * group_reduction;
var reduction = 0;
if (selectedCombination['specific_price'].reduction_price || selectedCombination['specific_price'].reduction_percent)
{
reduction_price = (specific_currency ? selectedCombination['specific_price'].reduction_price : selectedCombination['specific_price'].reduction_price * currencyRate);
reduction = productPriceDisplay * (parseFloat(selectedCombination['specific_price'].reduction_percent) / 100) + reduction_price;
if (reduction_price && (displayPrice || noTaxForThisProduct))
reduction = ps_round(reduction / tax, 6);
}
else if (product_specific_price && product_specific_price.reduction && !selectedCombination.specific_price)
{
if (product_specific_price.reduction_type == 'amount')
reduction_price = (specific_currency ? product_specific_price.reduction : product_specific_price.reduction * currencyRate);
else
reduction_price = 0;
if (product_specific_price.reduction_type == 'percentage')
reduction_percent = productPriceDisplay * parseFloat(product_specific_price.reduction);
reduction = reduction_price + reduction_percent;
if (reduction_price && (displayPrice || noTaxForThisProduct))
reduction = ps_round(reduction / tax, 6);
}
if (selectedCombination.specific_price)
{
if (selectedCombination['specific_price'] && selectedCombination['specific_price'].reduction_type == 'percentage')
{
$('#reduction_amount').hide();
$('#reduction_percent_display').html('-' + parseFloat(selectedCombination['specific_price'].reduction_percent) + '%');
$('#reduction_percent').show();
} else if (selectedCombination['specific_price'].reduction_type == 'amount' && selectedCombination['specific_price'].reduction_price != 0) {
$('#reduction_amount_display').html('-' + formatCurrency(reduction_price, currencyFormat, currencySign, currencyBlank));
$('#reduction_percent').hide();
$('#reduction_amount').show();
} else {
$('#reduction_percent').hide();
$('#reduction_amount').hide();
}
}
if (product_specific_price['reduction_type'] != '' || selectedCombination['specific_price'].reduction_type != '')
$('#discount_reduced_price,#old_price').show();
else
$('#discount_reduced_price,#old_price').hide();
if ((product_specific_price['reduction_type'] == 'percentage' && selectedCombination['specific_price'].reduction_type == 'percentage') || selectedCombination['specific_price'].reduction_type == 'percentage')
$('#reduction_percent').show();
else
$('#reduction_percent').hide();
if (product_specific_price['price'] || (selectedCombination.specific_price && selectedCombination.specific_price['price']))
$('#not_impacted_by_discount').show();
else
$('#not_impacted_by_discount').hide();
productPriceDisplay -= reduction;
productPriceDisplay = ps_round(productPriceDisplay * group_reduction, 2);
var ecotaxAmount = !displayPrice ? ps_round(selectedCombination['ecotax'] * (1 + ecotaxTax_rate / 100), 2) : selectedCombination['ecotax'];
if (ecotaxAmount != default_eco_tax)
productPriceDisplay += ecotaxAmount - default_eco_tax;
else
productPriceDisplay += ecotaxAmount;
if (ecotaxAmount != default_eco_tax)
productPriceWithoutReductionDisplay += ecotaxAmount - default_eco_tax;
else
productPriceWithoutReductionDisplay += ecotaxAmount;
var our_price = '';
if (productPriceDisplay > 0) {
our_price = formatCurrency(productPriceDisplay, currencyFormat, currencySign, currencyBlank);
} else {
our_price = formatCurrency(0, currencyFormat, currencySign, currencyBlank);
}
$('#our_price_display').text(our_price);
$('#old_price_display').text(formatCurrency(productPriceWithoutReductionDisplay, currencyFormat, currencySign, currencyBlank));
if (productPriceWithoutReductionDisplay > productPriceDisplay)
$('#old_price,#old_price_display,#old_price_display_taxes').show();
else
$('#old_price,#old_price_display,#old_price_display_taxes').hide();
// Special feature: "Display product price tax excluded on product page"
var productPricePretaxed = '';
if (!noTaxForThisProduct)
productPricePretaxed = productPriceDisplay / tax;
else
productPricePretaxed = productPriceDisplay;
$('#pretaxe_price_display').text(formatCurrency(productPricePretaxed, currencyFormat, currencySign, currencyBlank));
// Unit price
productUnitPriceRatio = parseFloat(productUnitPriceRatio);
if (productUnitPriceRatio > 0 )
{
newUnitPrice = (productPriceDisplay / parseFloat(productUnitPriceRatio)) + selectedCombination['unit_price'];
$('#unit_price_display').text(formatCurrency(newUnitPrice, currencyFormat, currencySign, currencyBlank));
}
// Ecotax
ecotaxAmount = !displayPrice ? ps_round(selectedCombination['ecotax'] * (1 + ecotaxTax_rate / 100), 2) : selectedCombination['ecotax'];
$('#ecotax_price_display').text(formatCurrency(ecotaxAmount, currencyFormat, currencySign, currencyBlank));
}
}
//update display of the large image
function displayImage(domAAroundImgThumb, no_animation)
{
if (typeof(no_animation) == 'undefined')
no_animation = false;
if (domAAroundImgThumb.prop('href'))
{
var new_src = domAAroundImgThumb.prop('href').replace('thickbox', 'large');
var new_title = domAAroundImgThumb.prop('title');
var new_href = domAAroundImgThumb.prop('href');
if ($('#bigpic').prop('src') != new_src)
{
$('#bigpic').prop({
'src' : new_src,
'alt' : new_title,
'title' : new_title
}).load(function(){
if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled)
$(this).prop('rel', new_href);
});
}
$('#views_block li a').removeClass('shown');
$(domAAroundImgThumb).addClass('shown');
}
}
//update display of the discounts table
function displayDiscounts(combination)
{
$('#quantityDiscount tbody tr').each(function() {
if (($(this).attr('id') != 'quantityDiscount_0') &&
($(this).attr('id') != 'quantityDiscount_' + combination) &&
($(this).attr('id') != 'noQuantityDiscount'))
$(this).fadeOut('slow');
});
if ($('#quantityDiscount_' + combination+',.quantityDiscount_' + combination).length != 0)
{
$('#quantityDiscount_' + combination+',.quantityDiscount_' + combination).show();
$('#noQuantityDiscount').hide();
}
else
$('#noQuantityDiscount').show();
}
// Serialscroll exclude option bug ?
function serialScrollFixLock(event, targeted, scrolled, items, position)
{
serialScrollNbImages = $('#thumbs_list li:visible').length;
serialScrollNbImagesDisplayed = 3;
var leftArrow = position == 0 ? true : false;
var rightArrow = position + serialScrollNbImagesDisplayed >= serialScrollNbImages ? true : false;
$('#view_scroll_left').css('cursor', leftArrow ? 'default' : 'pointer').css('display', leftArrow ? 'none' : 'block').fadeTo(0, leftArrow ? 0 : 1);
$('#view_scroll_right').css('cursor', rightArrow ? 'default' : 'pointer').fadeTo(0, rightArrow ? 0 : 1).css('display', rightArrow ? 'none' : 'block');
return true;
}
// Change the current product images regarding the combination selected
function refreshProductImages(id_product_attribute)
{
$('#thumbs_list_frame').scrollTo('li:eq(0)', 700, {axis:'x'});
id_product_attribute = parseInt(id_product_attribute);
if (id_product_attribute > 0 && typeof(combinationImages) != 'undefined' && typeof(combinationImages[id_product_attribute]) != 'undefined')
{
$('#thumbs_list li').hide();
$('#thumbs_list').trigger('goto', 0);
for (var i = 0; i < combinationImages[id_product_attribute].length; i++)
$('#thumbnail_' + parseInt(combinationImages[id_product_attribute][i])).show();
if (parseInt($('#thumbs_list_frame >li:visible').length) < parseInt($('#thumbs_list_frame >li').length))
$('#wrapResetImages').show('slow');
else
$('#wrapResetImages').hide('slow');
}
else
{
$('#thumbs_list li').show();
if (parseInt($('#thumbs_list_frame >li').length) == parseInt($('#thumbs_list_frame >li:visible').length))
$('#wrapResetImages').hide('slow');
}
var thumb_width = $('#thumbs_list_frame >li').width() + parseInt($('#thumbs_list_frame >li').css('marginRight'));
$('#thumbs_list_frame').width((parseInt((thumb_width) * $('#thumbs_list_frame >li').length)) + 'px');
$('#thumbs_list').trigger('goto', 0);
serialScrollFixLock('', '', '', '', 0);// SerialScroll Bug on goto 0 ?
}
//To do after loading HTML
$(document).ready(function()
{
//init the serialScroll for thumbs
$('#thumbs_list').serialScroll({
items:'li:visible',
prev:'#view_scroll_left',
next:'#view_scroll_right',
axis:'x',
offset:0,
start:0,
stop:true,
onBefore:serialScrollFixLock,
duration:700,
step: 2,
lazy: true,
lock: false,
force:false,
cycle:false
});
$('#thumbs_list').trigger('goto', 1);// SerialScroll Bug on goto 0 ?
$('#thumbs_list').trigger('goto', 0);
//hover 'other views' images management
$('#views_block li a').hover(
function(){displayImage($(this));},
function(){}
);
//set jqZoom parameters if needed
if (typeof(jqZoomEnabled) != 'undefined' && jqZoomEnabled)
{
$('#bigpic').attr('rel', $('#bigpic').attr('src').replace('large', 'thickbox'));
$('img.jqzoom').jqueryzoom({
xzoom: 200, //zooming div default width(default width value is 200)
yzoom: 200, //zooming div default width(default height value is 200)
offset: 21 //zooming div default offset(default offset value is 10)
//position: "right" //zooming div position(default position value is "right")
});
}
//add a link on the span 'view full size' and on the big image
$('#view_full_size, #image-block img').click(function(){
$('#views_block .shown').click();
});
//catch the click on the "more infos" button at the top of the page
$('#short_description_block .button').click(function(){
$('#more_info_tab_more_info').click();
$.scrollTo( '#more_info_tabs', 1200 );
});
// Hide the customization submit button and display some message
$('#customizedDatas input').click(function() {
$('#customizedDatas input').hide();
$('#ajax-loader').fadeIn();
$('#customizedDatas').append(uploading_in_progress);
});
original_url = window.location + '';
first_url_check = true;
checkUrl();
initLocationChange();
//init the price in relation of the selected attributes
if (typeof productHasAttributes != 'undefined' && productHasAttributes)
findCombination(true);
else if (typeof productHasAttributes != 'undefined' && !productHasAttributes)
refreshProductImages(0);
$('#resetImages').click(function() {
refreshProductImages(0);
});
$('.thickbox').fancybox({
'hideOnContentClick': true,
'transitionIn' : 'elastic',
'transitionOut' : 'elastic'
});
});
function saveCustomization()
{
$('#quantityBackup').val($('#quantity_wanted').val());
customAction = $('#customizationForm').attr('action');
$('body select[id^="group_"]').each(function() {
customAction = customAction.replace(new RegExp(this.id + '=\\d+'), this.id +'=' + this.value);
});
$('#customizationForm').attr('action', customAction);
$('#customizationForm').submit();
}
function submitPublishProduct(url, redirect, token)
{
var id_product = $('#admin-action-product-id').val();
$.ajaxSetup({async: false});
$.post(url + '/index.php', {
action:'publishProduct',
id_product: id_product,
status: 1,
redirect: redirect,
ajax: 1,
tab: 'AdminProducts',
token: token
},
function(data)
{
if (data.indexOf('error') === -1)
document.location.href = data;
}
);
return true;
}
function checkMinimalQuantity(minimal_quantity)
{
if ($('#quantity_wanted').val() < minimal_quantity)
{
$('#quantity_wanted').css('border', '1px solid red');
$('#minimal_quantity_wanted_p').css('color', 'red');
}
else
{
$('#quantity_wanted').css('border', '1px solid #BDC2C9');
$('#minimal_quantity_wanted_p').css('color', '#374853');
}
}
function colorPickerClick(elt)
{
id_attribute = $(elt).attr('id').replace('color_', '');
$(elt).parent().parent().children().removeClass('selected');
$(elt).fadeTo('fast', 1, function(){
$(this).fadeTo('fast', 0, function(){
$(this).fadeTo('fast', 1, function(){
$(this).parent().addClass('selected');
});
});
});
$(elt).parent().parent().parent().children('.color_pick_hidden,#color_pick_hidden').val(id_attribute);
findCombination(false);
}
function getProductAttribute()
{
// get product attribute id
product_attribute_id = $('#idCombination').val();
product_id = $('#product_page_product_id').val();
// get every attributes values
request = '';
//create a temporary 'tab_attributes' array containing the choices of the customer
var tab_attributes = [];
$('#attributes select, #attributes input[type=hidden], #attributes input[type=radio]:checked').each(function(){
tab_attributes.push($(this).val());
});
// build new request
for (var i in attributesCombinations)
for (var a in tab_attributes)
if (attributesCombinations[i]['id_attribute'] === tab_attributes[a])
request += '/'+attributesCombinations[i]['group'] + '-' + attributesCombinations[i]['attribute'];
request = request.replace(request.substring(0, 1), '#/');
url = window.location + '';
// redirection
if (url.indexOf('#') != -1)
url = url.substring(0, url.indexOf('#'));
// set ipa to the customization form
$('#customizationForm').attr('action', $('#customizationForm').attr('action') + request);
window.location = url + request;
}
function initLocationChange(time)
{
if(!time) time = 500;
setInterval(checkUrl, time);
}
function checkUrl()
{
if (original_url != window.location || first_url_check)
{
first_url_check = false;
url = window.location + '';
// if we need to load a specific combination
if (url.indexOf('#/') != -1)
{
// get the params to fill from a "normal" url
params = url.substring(url.indexOf('#') + 1, url.length);
tabParams = params.split('/');
tabValues = [];
if (tabParams[0] == '')
tabParams.shift();
for (var i in tabParams)
tabValues.push(tabParams[i].split('-'));
product_id = $('#product_page_product_id').val();
// fill html with values
$('.color_pick').removeClass('selected');
$('.color_pick').parent().parent().children().removeClass('selected');
count = 0;
for (var z in tabValues)
for (var a in attributesCombinations)
if (attributesCombinations[a]['group'] === decodeURIComponent(tabValues[z][0])
&& attributesCombinations[a]['attribute'] === tabValues[z][1])
{
count++;
// add class 'selected' to the selected color
$('#color_' + attributesCombinations[a]['id_attribute']).addClass('selected');
$('#color_' + attributesCombinations[a]['id_attribute']).parent().addClass('selected');
$('input:radio[value=' + attributesCombinations[a]['id_attribute'] + ']').attr('checked', true);
$('input:hidden[name=group_' + attributesCombinations[a]['id_attribute_group'] + ']').val(attributesCombinations[a]['id_attribute']);
$('select[name=group_' + attributesCombinations[a]['id_attribute_group'] + ']').val(attributesCombinations[a]['id_attribute']);
}
// find combination
if (count >= 0)
{
findCombination(false);
original_url = url;
}
// no combination found = removing attributes from url
else
window.location = url.substring(0, url.indexOf('#'));
}
}
}
+297
View File
@@ -0,0 +1,297 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{capture assign='page_title'}{l s='Order'} {l s='#'}{$order->id|string_format:"%06d"}{/capture}
{include file='./page-title.tpl'}
<div class="ui-grid-a">
<div class="ui-block-a">
<a data-role="button" data-icon="arrow-l" data-theme="a" data-rel="back" href="#" title="" data-ajax="false">{l s='Back'}</a>
</div>
<div class="ui-block-b">
{assign var='type_order' value="order"}
{if isset($opc) && $opc}
{assign var='type_order' value="order-opc"}
{/if}
<a data-icon="refresh" data-role="button" data-theme="e" href="{$link->getPageLink({$type_order}, true, NULL, "submitReorder&id_order={$order->id|intval}")|escape:'html'}" title="{l s='Reorder'}" data-ajax="false">
{l s='Reorder'}
</a>
</div>
</div><!-- .ui-grid-a -->
<div data-role="content" id="content">
<h3 class="bg">{l s='Order #%s - placed on' sprintf=$order->id|string_format:"%06d"} {dateFormat date=$order->date_add full=0}</h3>
<ul class="info-order" data-role="listview">
{if $carrier->id}<li><strong>{l s='Carrier'}</strong> {if $carrier->name == "0"}{$shop_name|escape:'htmlall':'UTF-8'}{else}{$carrier->name|escape:'htmlall':'UTF-8'}{/if}</li>{/if}
<li><strong>{l s='Payment method'}</strong> <span class="color-myaccount">{$order->payment|escape:'htmlall':'UTF-8'}</span></li>
{if $invoice AND $invoiceAllowed}
<li>
<img src="{$img_dir}icon/pdf.gif" alt="" class="icon" />
<a href="{$link->getPageLink('pdf-invoice', true)}?id_order={$order->id|intval}{if $is_guest}&secure_key={$order->secure_key}{/if}" data-ajax="false">{l s='Download your invoice as a PDF file.'}</a>
</li>
{/if}
{if $order->recyclable}
<li><img src="{$img_dir}icon/recyclable.gif" alt="" class="icon" />&nbsp;{l s='You have given permission to receive your order in recycled packaging.'}</li>
{/if}
{if $order->gift}
<li><img src="{$img_dir}icon/gift.gif" alt="" class="icon" />&nbsp;{l s='You have requested gift wrapping for this order.'}</li>
<li>{l s='Message'} {$order->gift_message|nl2br}</li>
{/if}
</ul><!-- .info-order -->
{if count($order_history)}
<h3 class="bg">{l s='Follow your order\'s status step-by-step'}</h3>
<ul data-role="listview" >
{foreach from=$order_history item=state name="orderStates"}
<li>
{$state.ostate_name|escape:'htmlall':'UTF-8'}
<span class="ui-li-aside">{dateFormat date=$state.date_add full=1}</span>
</li>
{/foreach}
</ul>
{/if}
{* > TO CHECK ==========================*}
{if isset($followup)}
<p class="bold">{l s='Click the following link to track the delivery of your order'}</p>
<a href="{$followup|escape:'htmlall':'UTF-8'}" data-ajax="false">{$followup|escape:'htmlall':'UTF-8'}</a>
{/if}
{* / TO CHECK ==========================*}
<h3 class="bg">{l s='Addresses'}</h3>
<div class="adresses_bloc clearfix">
{* > TO CHECK ==========================*}
{if $invoice AND $invoiceAllowed}
<p>
<img src="{$img_dir}icon/pdf.gif" alt="" class="icon" />
{if $is_guest}
<a href="{$link->getPageLink('pdf-invoice', true, NULL, "id_order={$order->id}&amp;secure_key=$order->secure_key")|escape:'html'}" >{l s='Download your invoice as a PDF file.'}</a>
{else}
<a href="{$link->getPageLink('pdf-invoice', true, NULL, "id_order={$order->id}")|escape:'html'}" >{l s='Download your invoice as a PDF file.'}</a>
{/if}
</p>
{/if}
{if $order->recyclable && isset($isRecyclable) && $isRecyclable}
<p><img src="{$img_dir}icon/recyclable.gif" alt="" class="icon" />&nbsp;{l s='You have given permission to receive your order in recycled packaging.'}</p>
{/if}
{if $order->gift}
<p><img src="{$img_dir}icon/gift.gif" alt="" class="icon" />&nbsp;{l s='You have requested gift wrapping for this order.'}</p>
<p>{l s='Message'} {$order->gift_message|nl2br}</p>
{/if}
{* / TO CHECK ==========================*}
<ul data-role="listview" data-inset="true" data-dividertheme="c">
{if !$order->isVirtual()}
<li data-role="list-divider">{l s='Invoice'}</li>
<li>
{foreach from=$inv_adr_fields name=inv_loop item=field_item}
{if $field_item eq "company" && isset($address_invoice->company)}<p class="address_company">{$address_invoice->company|escape:'htmlall':'UTF-8'}</p>
{elseif $field_item eq "address2" && $address_invoice->address2}<p class="address_address2">{$address_invoice->address2|escape:'htmlall':'UTF-8'}</p>
{elseif $field_item eq "phone_mobile" && $address_invoice->phone_mobile}<p class="address_phone_mobile">{$address_invoice->phone_mobile|escape:'htmlall':'UTF-8'}</p>
{else}
{assign var=address_words value=" "|explode:$field_item}
<p>{foreach from=$address_words item=word_item name="word_loop"}{if !$smarty.foreach.word_loop.first} {/if}<span class="address_{$word_item|replace:',':''}">{$invoiceAddressFormatedValues[$word_item|replace:',':'']|escape:'htmlall':'UTF-8'}</span>{/foreach}</p>
{/if}
{/foreach}
</li>
{/if}
<li data-role="list-divider" >{l s='Delivery'}</li>
<li>
{foreach from=$dlv_adr_fields name=dlv_loop item=field_item}
{if $field_item eq "company" && isset($address_delivery->company)}<p class="address_company">{$address_delivery->company|escape:'htmlall':'UTF-8'}</p>
{elseif $field_item eq "address2" && $address_delivery->address2}<p class="address_address2">{$address_delivery->address2|escape:'htmlall':'UTF-8'}</p>
{elseif $field_item eq "phone_mobile" && $address_delivery->phone_mobile}<p class="address_phone_mobile">{$address_delivery->phone_mobile|escape:'htmlall':'UTF-8'}</p>
{else}
{assign var=address_words value=" "|explode:$field_item}
<p>{foreach from=$address_words item=word_item name="word_loop"}{if !$smarty.foreach.word_loop.first} {/if}<span class="address_{$word_item|replace:',':''}">{$deliveryAddressFormatedValues[$word_item|replace:',':'']|escape:'htmlall':'UTF-8'}</span>{/foreach}</p>
{/if}
{/foreach}
</li>
</ul>
</div><!-- .adresses_bloc -->
<!-- order details -->
<h3 class="bg">{l s='Order details'}</h3>
{* > TO CHECK ==========================*}
{*$HOOK_ORDERDETAILDISPLAYED*}
{* / TO CHECK ==========================*}
{if $return_allowed}<p>{l s='If you wish to return one or more products, please mark the corresponding boxes and provide an explanation for the return. When complete, click the button below.'}</p>{/if}
{if !$is_guest}<form action="{$link->getPageLink('order-follow', true)|escape:'html'}" method="post">{/if}
<ul data-role="listview" data-inset="true">
{foreach from=$products item=product name=products}
{if !isset($product.deleted)}
{assign var='productId' value=$product.product_id}
{assign var='productAttributeId' value=$product.product_attribute_id}
{if isset($product.customizedDatas)}
{assign var='productQuantity' value=$product.product_quantity-$product.customizationQuantityTotal}
{else}
{assign var='productQuantity' value=$product.product_quantity}
{/if}
{include file="./order-detail-product-li.tpl"}
{/if}
{/foreach}
{* > TO CHECK ==========================*}
{foreach from=$discounts item=discount}
<li class="item">
<h3>{$discount.name|escape:'htmlall':'UTF-8'}</h3>
<p>{l s='Voucher'} {$discount.name|escape:'htmlall':'UTF-8'}</p>
<p><span class="order_qte_span editable">1</span></p>
<p>&nbsp;</p>
<p>{if $discount.value != 0.00}{l s='-'}{/if}{convertPriceWithCurrency price=$discount.value currency=$currency}</p>
{if $return_allowed}
<p>&nbsp;</p>
{/if}
</li>
{/foreach}
{* / TO CHECK ==========================*}
{if $priceDisplay && $use_tax}
<li data-theme="b" class="item">
{l s='Total products (tax excl.)'} <span class="price">{displayWtPriceWithCurrency price=$order->getTotalProductsWithoutTaxes() currency=$currency}</span>
</li>
{/if}
<li data-theme="b" class="item">
{l s='Total products'} {if $use_tax}{l s='(tax incl.)'}{/if}: <span class="price">{displayWtPriceWithCurrency price=$order->getTotalProductsWithTaxes() currency=$currency}</span>
</li>
{if $order->total_discounts > 0}
<li data-theme="b" class="item">
{l s='Total vouchers:'} <span class="price-discount">{displayWtPriceWithCurrency price=$order->total_discounts currency=$currency convert=1}</span>
</li>
{/if}
{if $order->total_wrapping > 0}
<li data-theme="b" class="item">
{l s='Total gift wrapping cost:'} <span class="price-wrapping">{displayWtPriceWithCurrency price=$order->total_wrapping currency=$currency}</span>
</li>
{/if}
<li data-theme="b" class="item">
{l s='Total shipping'} {if $use_tax}{l s='(tax incl.)'}{/if}: <span class="price-shipping">{displayWtPriceWithCurrency price=$order->total_shipping currency=$currency}</span>
</li>
<li data-theme="a" class="totalprice item">
{l s='Total'} <span class="price">{displayWtPriceWithCurrency price=$order->total_paid currency=$currency}</span>
</li>
</ul>
<!-- /order details -->
{if $order->getShipping()|count > 0}
<h3 class="bg">{l s='Carrier'}</h3>
<ul data-role="listview" >
{foreach from=$order->getShipping() item=line}
<li>
<h3>{$line.carrier_name}</h3>
<p><strong>{l s='Weight'}</strong> {$line.weight|string_format:"%.3f"} {Configuration::get('PS_WEIGHT_UNIT')}</p>
<p><strong>{l s='Shipping cost'}</strong> {if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_INC}{displayPrice price=$line.shipping_cost_tax_incl currency=$currency->id}{else}{displayPrice price=$line.shipping_cost_tax_excl currency=$currency->id}{/if}</p>
<p><strong>{l s='Tracking number'}</strong> {if $line.url && $line.tracking_number}<a href="{$line.url|replace:'@':$line.tracking_number}" data-ajax="false">{$line.tracking_number}</a>{elseif $line.tracking_number != ''}{$line.tracking_number}{else}----{/if}</p>
<span class="ui-li-aside">{$line.date_add}</span>
</li>
{/foreach}
</ul>
{/if}
{* > TO CHECK ==========================*}
{if !$is_guest}
{if $return_allowed}
<div id="returnOrderMessage">
<h3>{l s='Merchandise return'}</h3>
<p>{l s='If you wish to return one or more products, please mark the corresponding boxes and provide an explanation for the return. When complete, click the button below.'}</p>
<fieldset>
<textarea cols="67" rows="3" name="returnText"></textarea>
</fieldset>
<fieldset>
<input type="submit" data-theme="a" value="{l s='Make an RMA slip'}" name="submitReturnMerchandise" class="button_large" />
<input type="hidden" class="hidden" value="{$order->id|intval}" name="id_order" />
</fieldset>
</div>
<br />
{/if}
</form>
{if count($messages)}
<h3>{l s='Messages'}</h3>
<div class="table_block">
<table class="detail_step_by_step std">
<thead>
<tr>
<th class="first_item" style="width:150px;">{l s='From'}</th>
<th class="last_item">{l s='Message'}</th>
</tr>
</thead>
<tbody>
{foreach from=$messages item=message name="messageList"}
<tr class="{if $smarty.foreach.messageList.first}first_item{elseif $smarty.foreach.messageList.last}last_item{/if} {if $smarty.foreach.messageList.index % 2}alternate_item{else}item{/if}">
<td>
{if isset($message.ename) && $message.ename}
{$message.efirstname|escape:'htmlall':'UTF-8'} {$message.elastname|escape:'htmlall':'UTF-8'}
{elseif $message.clastname}
{$message.cfirstname|escape:'htmlall':'UTF-8'} {$message.clastname|escape:'htmlall':'UTF-8'}
{else}
<b>{$shop_name|escape:'htmlall':'UTF-8'}</b>
{/if}
<br />
{dateFormat date=$message.date_add full=1}
</td>
<td>{$message.message|nl2br}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{/if}
{if isset($errors) && $errors}
<div class="error">
<p>{if $errors|@count > 1}{l s='There are %d errors' sprintf=$errors|@count}{else}{l s='There is %d error' sprintf=$errors|@count}{/if} :</p>
<ol>
{foreach from=$errors key=k item=error}
<li>{$error}</li>
{/foreach}
</ol>
</div>
{/if}
{* / TO CHECK ==========================*}
<form action="{$link->getPageLink('order-detail', true)|escape:'html'}" method="post" class="std" id="sendOrderMessage">
<h3 class="bg">{l s='Add a message'}</h3>
<p>{l s='If you would like to add a comment about your order, please write it in the field below.'}</p>
<fieldset>
<label for="id_product">{l s='Product'}</label>
<select name="id_product">
<option value="0">{l s='-- Choose --'}</option>
{foreach from=$products item=product name=products}
<option value="{$product.product_id}">{$product.product_name}</option>
{/foreach}
</select>
</fieldset>
<fieldset>
<textarea name="msgText"></textarea>
</fieldset>
<input type="hidden" name="id_order" value="{$order->id|intval}" />
<input type="submit" data-role="button" data-theme="a" name="submitMessage" value="{l s='Send'}"/>
</form>
{else}
<p><img src="{$img_dir}icon/infos.gif" alt="" class="icon" />&nbsp;{l s='You cannot return merchandise with a guest account'}</p>
{/if}
</div><!-- #content -->
@@ -0,0 +1,41 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<!-- Block search module -->
<div id="search_block_left" class="block exclusive">
<p class="title_block">{l s='Search' mod='blocksearch'}</p>
<form method="get" action="{$link->getPageLink('search', true)|escape:'html'}" id="searchbox">
<p class="block_content">
<label for="search_query_block">{l s='Enter a product name' mod='blocksearch'}</label>
<input type="hidden" name="orderby" value="position" />
<input type="hidden" name="controller" value="search" />
<input type="hidden" name="orderway" value="desc" />
<input class="search_query" type="text" id="search_query_block" name="search_query" value="{$search_query|escape:'htmlall':'UTF-8'|stripslashes}" />
<input type="submit" id="search_button" class="button_mini" value="{l s='go' mod='blocksearch'}" />
</p>
</form>
</div>
{include file="$self/blocksearch-instantsearch.tpl"}
<!-- /Block search module -->
@@ -0,0 +1,160 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<script type="text/javascript">
var productcomments_controller_url = '{$productcomments_controller_url}';
var confirm_report_message = '{l s='Are you sure you want report this comment?' mod='productcomments' js=1}';
var secure_key = '{$secure_key}';
var productcomments_url_rewrite = '{$productcomments_url_rewriting_activated}';
var productcomment_added = '{l s='Your comment has been added!' mod='productcomments' js=1}';
var productcomment_added_moderation = '{l s='Your comment has been added and will be available once approved by a moderator' mod='productcomments' js=1}';
var productcomment_title = '{l s='New comment' mod='productcomments' js=1}';
var productcomment_ok = '{l s='OK' mod='productcomments' js=1}';
var moderation_active = {$moderation_active};
</script>
<div id="idTab5">
<div id="product_comments_block_tab">
{if $comments}
{foreach from=$comments item=comment}
{if $comment.content}
<div class="comment clearfix">
<div class="comment_author">
<span>{l s='Grade' mod='productcomments'}&nbsp</span>
<div class="star_content clearfix">
{section name="i" start=0 loop=5 step=1}
{if $comment.grade le $smarty.section.i.index}
<div class="star"></div>
{else}
<div class="star star_on"></div>
{/if}
{/section}
</div>
<div class="comment_author_infos">
<strong>{$comment.customer_name|escape:'html':'UTF-8'}</strong><br/>
<em>{dateFormat date=$comment.date_add|escape:'html':'UTF-8' full=0}</em>
</div>
</div>
<div class="comment_details">
<p class="title_block">{$comment.title}</p>
<p>{$comment.content|escape:'html':'UTF-8'|nl2br}</p>
<ul>
{if $comment.total_advice > 0}
<li>{l s='%1$d out of %2$d people found this review useful.' sprintf=[$comment.total_useful,$comment.total_advice] mod='productcomments'}</li>
{/if}
{if $logged == 1}
{if !$comment.customer_advice}
<li>{l s='Was this comment useful to you?' mod='productcomments'}<button class="usefulness_btn" data-is-usefull="1" data-id-product-comment="{$comment.id_product_comment}">{l s='yes' mod='productcomments'}</button><button class="usefulness_btn" data-is-usefull="0" data-id-product-comment="{$comment.id_product_comment}">{l s='no' mod='productcomments'}</button></li>
{/if}
{if !$comment.customer_report}
<li><span class="report_btn" data-id-product-comment="{$comment.id_product_comment}">{l s='Report abuse' mod='productcomments'}</span></li>
{/if}
{/if}
</ul>
</div>
</div>
{/if}
{/foreach}
{if (!$too_early AND ($logged OR $allow_guests))}
<p class="align_center">
<a id="new_comment_tab_btn" class="open-comment-form" href="#new_comment_form">{l s='Write your review' mod='productcomments'} !</a>
</p>
{/if}
{else}
{if (!$too_early AND ($logged OR $allow_guests))}
<p class="align_center">
<a id="new_comment_tab_btn" class="open-comment-form" href="#new_comment_form">{l s='Be the first to write your review' mod='productcomments'} !</a>
</p>
{else}
<p class="align_center">{l s='No customer comments for the moment.' mod='productcomments'}</p>
{/if}
{/if}
</div>
</div>
{if isset($product) && $product}
<!-- Fancybox -->
<div style="display: none;">
<div id="new_comment_form">
<form id="id_new_comment_form" action="#">
<h2 class="title">{l s='Write your review' mod='productcomments'}</h2>
{if isset($product) && $product}
<div class="product clearfix">
<img src="{$link->getImageLink($product->link_rewrite, $productcomment_cover, 'home_default')|escape:'html'}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product->name|escape:html:'UTF-8'}" />
<div class="product_desc">
<p class="product_name"><strong>{$product->name}</strong></p>
{$product->description_short}
</div>
</div>
{/if}
<div class="new_comment_form_content">
<h2>{l s='Write your review' mod='productcomments'}</h2>
<div id="new_comment_form_error" class="error" style="display: none; padding: 15px 25px">
<ul></ul>
</div>
{if $criterions|@count > 0}
<ul id="criterions_list">
{foreach from=$criterions item='criterion'}
<li>
<label>{$criterion.name|escape:'html':'UTF-8'}:</label>
<div class="star_content">
<input class="star" type="radio" name="criterion[{$criterion.id_product_comment_criterion|round}]" value="1" />
<input class="star" type="radio" name="criterion[{$criterion.id_product_comment_criterion|round}]" value="2" />
<input class="star" type="radio" name="criterion[{$criterion.id_product_comment_criterion|round}]" value="3" checked="checked" />
<input class="star" type="radio" name="criterion[{$criterion.id_product_comment_criterion|round}]" value="4" />
<input class="star" type="radio" name="criterion[{$criterion.id_product_comment_criterion|round}]" value="5" />
</div>
<div class="clearfix"></div>
</li>
{/foreach}
</ul>
{/if}
<label for="comment_title">{l s='Title' mod='productcomments'}: <sup class="required">*</sup></label>
<input id="comment_title" name="title" type="text" value=""/>
<label for="content">{l s='Comment' mod='productcomments'}: <sup class="required">*</sup></label>
<textarea id="content" name="content"></textarea>
{if $allow_guests == true && $logged == 0}
<label>{l s='Your name' mod='productcomments'}: <sup class="required">*</sup></label>
<input id="commentCustomerName" name="customer_name" type="text" value=""/>
{/if}
<div id="new_comment_form_footer">
<input id="id_product_comment_send" name="id_product" type="hidden" value='{$id_product_comment_form}' />
<p class="fl required"><sup>*</sup> {l s='Required fields' mod='productcomments'}</p>
<p class="fr">
<button id="submitNewMessage" name="submitMessage" type="submit">{l s='Send' mod='productcomments'}</button>&nbsp;
{l s='or' mod='productcomments'}&nbsp;<a href="#" onclick="$.fancybox.close();">{l s='Cancel' mod='productcomments'}</a>
</p>
<div class="clearfix"></div>
</div>
</div>
</form><!-- /end new_comment_form_content -->
</div>
</div>
<!-- End fancybox -->
{/if}
+314
View File
@@ -0,0 +1,314 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if !$opc}
<script type="text/javascript">
//<![CDATA[
var orderProcess = 'order';
var currencySign = '{$currencySign|html_entity_decode:2:"UTF-8"}';
var currencyRate = '{$currencyRate|floatval}';
var currencyFormat = '{$currencyFormat|intval}';
var currencyBlank = '{$currencyBlank|intval}';
var txtProduct = "{l s='Product' js=1}";
var txtProducts = "{l s='Products' js=1}";
var orderUrl = '{$link->getPageLink("order", true)|addslashes}';
var msg = "{l s='You must agree to the terms of service before continuing.' js=1}";
{literal}
function acceptCGV()
{
if ($('#cgv').length && !$('input#cgv:checked').length)
{
alert(msg);
return false;
}
else
return true;
}
{/literal}
//]]>
</script>
{else}
<script type="text/javascript">
var txtFree = "{l s='Free'}";
</script>
{/if}
{if isset($virtual_cart) && !$virtual_cart && $giftAllowed && $cart->gift == 1}
<script type="text/javascript">
{literal}
// <![CDATA[
$('document').ready( function(){
if ($('input#gift').is(':checked'))
$('p#gift_div').show();
});
//]]>
{/literal}
</script>
{/if}
{if !$opc}
{capture name=path}{l s='Shipping:'}{/capture}
{include file="$tpl_dir./breadcrumb.tpl"}
{/if}
{if !$opc}
<div id="carrier_area">
{else}
<div id="carrier_area" class="opc-main-block">
{/if}
{if !$opc}
<h1>{l s='Shipping:'}</h1>
{else}
<h2><span>2</span> {l s='Delivery methods'}</h2>
{/if}
{if !$opc}
{assign var='current_step' value='shipping'}
{include file="$tpl_dir./order-steps.tpl"}
{include file="$tpl_dir./errors.tpl"}
<form id="form" action="{$link->getPageLink('order', true, NULL, "multi-shipping={$multi_shipping}")|escape:'html'}" method="post" onsubmit="return acceptCGV();">
{else}
<div id="opc_delivery_methods" class="opc-main-block">
<div id="opc_delivery_methods-overlay" class="opc-overlay" style="display: none;"></div>
{/if}
<div class="order_carrier_content">
{if isset($virtual_cart) && $virtual_cart}
<input id="input_virtual_carrier" class="hidden" type="hidden" name="id_carrier" value="0" />
{else}
<h3 class="carrier_title">{l s='Choose your delivery method'}</h3>
<div id="HOOK_BEFORECARRIER">
{if isset($carriers) && isset($HOOK_BEFORECARRIER)}
{$HOOK_BEFORECARRIER}
{/if}
</div>
{if isset($isVirtualCart) && $isVirtualCart}
<p class="warning">{l s='No carrier is needed for this order.'}</p>
{else}
{if $recyclablePackAllowed}
<p class="checkbox">
<input type="checkbox" name="recyclable" id="recyclable" value="1" {if $recyclable == 1}checked="checked"{/if} autocomplete="off"/>
<label for="recyclable">{l s='I would like to receive my order in recycled packaging.'}.</label>
</p>
{/if}
<div class="delivery_options_address">
{if isset($delivery_option_list)}
{foreach $delivery_option_list as $id_address => $option_list}
<h3>
{if isset($address_collection[$id_address])}
{l s='Choose a shipping option for this address:'} {$address_collection[$id_address]->alias}
{else}
{l s='Choose a shipping option'}
{/if}
</h3>
<div class="delivery_options">
{foreach $option_list as $key => $option}
<div class="delivery_option {if ($option@index % 2)}alternate_{/if}item">
<input class="delivery_option_radio" type="radio" name="delivery_option[{$id_address}]" onchange="{if $opc}updateCarrierSelectionAndGift();{else}updateExtraCarrier('{$key}', {$id_address});{/if}" id="delivery_option_{$id_address}_{$option@index}" value="{$key}" {if isset($delivery_option[$id_address]) && $delivery_option[$id_address] == $key}checked="checked"{/if} />
<label for="delivery_option_{$id_address}_{$option@index}">
<table class="resume">
<tr>
<td class="delivery_option_logo">
{foreach $option.carrier_list as $carrier}
{if $carrier.logo}
<img src="{$carrier.logo}" alt="{$carrier.instance->name}"/>
{else if !$option.unique_carrier}
{$carrier.instance->name}
{if !$carrier@last} - {/if}
{/if}
{/foreach}
</td>
<td>
{if $option.unique_carrier}
{foreach $option.carrier_list as $carrier}
<div class="delivery_option_title">{$carrier.instance->name}</div>
{/foreach}
{if isset($carrier.instance->delay[$cookie->id_lang])}
<div class="delivery_option_delay">{$carrier.instance->delay[$cookie->id_lang]}</div>
{/if}
{/if}
{if count($option_list) > 1}
{if $option.is_best_grade}
{if $option.is_best_price}
<div class="delivery_option_best delivery_option_icon">{l s='The best price and speed'}</div>
{else}
<div class="delivery_option_fast delivery_option_icon">{l s='The fastest'}</div>
{/if}
{else}
{if $option.is_best_price}
<div class="delivery_option_best_price delivery_option_icon">{l s='The best price'}</div>
{/if}
{/if}
{/if}
</td>
<td>
<div class="delivery_option_price">
{if $option.total_price_with_tax && (!isset($free_shipping) || (isset($free_shipping) && !$free_shipping))}
{if $use_taxes == 1}
{if $priceDisplay == 1}
{convertPrice price=$option.total_price_without_tax} {l s='(tax excl.)'}
{else}
{convertPrice price=$option.total_price_with_tax} {l s='(tax incl.)'}
{/if}
{else}
{convertPrice price=$option.total_price_without_tax}
{/if}
{else}
{l s='Free'}
{/if}
</div>
</td>
</tr>
</table>
<table class="delivery_option_carrier {if isset($delivery_option[$id_address]) && $delivery_option[$id_address] == $key}selected{/if} {if $option.unique_carrier}not-displayable{/if}">
{foreach $option.carrier_list as $carrier}
<tr>
{if !$option.unique_carrier}
<td class="first_item">
<input type="hidden" value="{$carrier.instance->id}" name="id_carrier" />
{if $carrier.logo}
<img src="{$carrier.logo}" alt="{$carrier.instance->name}"/>
{/if}
</td>
<td>
{$carrier.instance->name}
</td>
{/if}
<td {if $option.unique_carrier}class="first_item" colspan="2"{/if}>
<input type="hidden" value="{$carrier.instance->id}" name="id_carrier" />
{if isset($carrier.instance->delay[$cookie->id_lang])}
{$carrier.instance->delay[$cookie->id_lang]}<br />
{if count($carrier.product_list) <= 1}
({l s='Product concerned:'}
{else}
({l s='Products concerned:'}
{/if}
{* This foreach is on one line, to avoid tabulation in the title attribute of the acronym *}
{foreach $carrier.product_list as $product}
{if $product@index == 4}<acronym title="{/if}{if $product@index >= 4}{$product.name}{if isset($product.attributes) && $product.attributes} {$product.attributes|escape:'htmlall':'UTF-8'}{/if}{if !$product@last}, {else}">...</acronym>){/if}{else}{$product.name}{if isset($product.attributes) && $product.attributes} {$product.attributes|escape:'htmlall':'UTF-8'}{/if}{if !$product@last}, {else}){/if}{/if}{/foreach}
{/if}
</td>
</tr>
{/foreach}
</table>
</label>
</div>
{/foreach}
</div>
<div class="hook_extracarrier" id="HOOK_EXTRACARRIER_{$id_address}">{if isset($HOOK_EXTRACARRIER_ADDR) && isset($HOOK_EXTRACARRIER_ADDR.$id_address)}{$HOOK_EXTRACARRIER_ADDR.$id_address}{/if}</div>
{foreachelse}
<p class="warning" id="noCarrierWarning">
{foreach $cart->getDeliveryAddressesWithoutCarriers(true) as $address}
{if empty($address->alias)}
{l s='No carriers available.'}
{else}
{l s='No carriers available for the address "%s".' sprintf=$address->alias}
{/if}
{if !$address@last}
<br />
{/if}
{foreachelse}
{l s='No carriers available.'}
{/foreach}
</p>
{/foreach}
{/if}
</div>
<div style="display: none;" id="extra_carrier"></div>
{if $giftAllowed}
<h3 class="gift_title">{l s='Gift'}</h3>
<p class="checkbox">
<input type="checkbox" name="gift" id="gift" value="1" {if $cart->gift == 1}checked="checked"{/if} autocomplete="off"/>
<label for="gift">{l s='I would like my order to be gift wrapped.'}</label>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{if $gift_wrapping_price > 0}
({l s='Additional cost of'}
<span class="price" id="gift-price">
{if $priceDisplay == 1}{convertPrice price=$total_wrapping_tax_exc_cost}{else}{convertPrice price=$total_wrapping_cost}{/if}
</span>
{if $use_taxes}{if $priceDisplay == 1} {l s='(tax excl.)'}{else} {l s='(tax incl.)'}{/if}{/if})
{/if}
</p>
<p id="gift_div" class="textarea">
<label for="gift_message">{l s='If you\'d like, you can add a note to the gift:'}</label>
<textarea rows="5" cols="35" id="gift_message" name="gift_message">{$cart->gift_message|escape:'htmlall':'UTF-8'}</textarea>
</p>
{/if}
{/if}
{/if}
{if $conditions AND $cms_id}
<h3 class="condition_title">{l s='Terms of service'}</h3>
<p class="checkbox">
<input type="checkbox" name="cgv" id="cgv" value="1" {if $checkedTOS}checked="checked"{/if} autocomplete="off"/>
<label for="cgv">{l s='I agree to the terms of service and will adhere to them unconditionally.'}</label> <a href="{$link_conditions}" class="iframe">{l s='(Read the Terms of Service)'}</a>
</p>
<script type="text/javascript">
$(document).ready(function() {
$("a.iframe").fancybox({
'type' : 'iframe',
'width':600,
'height':600
});
});
</script>
{/if}
</div>
{if !$opc}
<p class="cart_navigation submit">
<input type="hidden" name="step" value="3" />
<input type="hidden" name="back" value="{$back}" />
{if !$is_guest}
{if $back}
<a href="{$link->getPageLink('order', true, NULL, "step=1&back={$back}&multi-shipping={$multi_shipping}")|escape:'html'}" title="{l s='Previous'}" class="button">&laquo; {l s='Previous'}</a>
{else}
<a href="{$link->getPageLink('order', true, NULL, "step=1&multi-shipping={$multi_shipping}")|escape:'html'}" title="{l s='Previous'}" class="button">&laquo; {l s='Previous'}</a>
{/if}
{else}
<a href="{$link->getPageLink('order', true, NULL, "multi-shipping={$multi_shipping}")|escape:'html'}" title="{l s='Previous'}" class="button">&laquo; {l s='Previous'}</a>
{/if}
{if isset($virtual_cart) && $virtual_cart || (isset($delivery_option_list) && !empty($delivery_option_list))}
<input type="submit" name="processCarrier" value="{l s='Next'} &raquo;" class="exclusive" />
{/if}
</p>
</form>
{else}
<h3>{l s='Leave a message'}</h3>
<div>
<p>{l s='If you would like to add a comment about your order, please write it in the field below.'}</p>
<p><textarea cols="120" rows="3" name="message" id="message">{if isset($oldMessage)}{$oldMessage|escape:'htmlall':'UTF-8'}{/if}</textarea></p>
</div>
</div>
{/if}
</div>
+427
View File
@@ -0,0 +1,427 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if isset($order)}
<form action="{if isset($opc) && $opc}{$link->getPageLink('order-opc', true)}{else}{$link->getPageLink('order', true)}{/if}" method="post" class="submit">
<div>
<input type="hidden" value="{$order->id}" name="id_order"/>
<p class="title_block">
<input type="submit" value="{l s='Reorder'}" name="submitReorder" class="button exclusive" />
{l s='Order Reference %s - placed on' sprintf=$order->getUniqReference()} {dateFormat date=$order->date_add full=0}
</p>
</div>
</form>
<div class="info-order">
{if $carrier->id}<p><strong>{l s='Carrier'}</strong> {if $carrier->name == "0"}{$shop_name|escape:'htmlall':'UTF-8'}{else}{$carrier->name|escape:'htmlall':'UTF-8'}{/if}</p>{/if}
<p><strong>{l s='Payment method'}</strong> <span class="color-myaccount">{$order->payment|escape:'htmlall':'UTF-8'}</span></p>
{if $invoice AND $invoiceAllowed}
<p>
<img src="{$img_dir}icon/pdf.gif" alt="" class="icon" />
<a target="_blank" href="{$link->getPageLink('pdf-invoice', true)}?id_order={$order->id|intval}{if $is_guest}&secure_key={$order->secure_key}{/if}">{l s='Download your invoice as a PDF file.'}</a>
</p>
{/if}
{if $order->recyclable}
<p><img src="{$img_dir}icon/recyclable.gif" alt="" class="icon" />&nbsp;{l s='You have given permission to receive your order in recycled packaging.'}</p>
{/if}
{if $order->gift}
<p><img src="{$img_dir}icon/gift.gif" alt="" class="icon" />&nbsp;{l s='You have requested gift wrapping for this order.'}</p>
<p>{l s='Message'} {$order->gift_message|nl2br}</p>
{/if}
</div>
{if count($order_history)}
<h3>{l s='Follow your order\'s status step-by-step'}</h3>
<div class="table_block">
<table class="detail_step_by_step std">
<thead>
<tr>
<th class="first_item">{l s='Date'}</th>
<th class="last_item">{l s='Status'}</th>
</tr>
</thead>
<tbody>
{foreach from=$order_history item=state name="orderStates"}
<tr class="{if $smarty.foreach.orderStates.first}first_item{elseif $smarty.foreach.orderStates.last}last_item{/if} {if $smarty.foreach.orderStates.index % 2}alternate_item{else}item{/if}">
<td>{dateFormat date=$state.date_add full=1}</td>
<td>{$state.ostate_name|escape:'htmlall':'UTF-8'}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{/if}
{if isset($followup)}
<p class="bold">{l s='Click the following link to track the delivery of your order'}</p>
<a href="{$followup|escape:'htmlall':'UTF-8'}">{$followup|escape:'htmlall':'UTF-8'}</a>
{/if}
<div class="adresses_bloc clearfix">
<br />
<ul class="address item {if $order->isVirtual()}full_width{/if}">
<li class="address_title">{l s='Billing'}</li>
{foreach from=$inv_adr_fields name=inv_loop item=field_item}
{if $field_item eq "company" && isset($address_invoice->company)}<li class="address_company">{$address_invoice->company|escape:'htmlall':'UTF-8'}</li>
{elseif $field_item eq "address2" && $address_invoice->address2}<li class="address_address2">{$address_invoice->address2|escape:'htmlall':'UTF-8'}</li>
{elseif $field_item eq "phone_mobile" && $address_invoice->phone_mobile}<li class="address_phone_mobile">{$address_invoice->phone_mobile|escape:'htmlall':'UTF-8'}</li>
{else}
{assign var=address_words value=" "|explode:$field_item}
<li>{foreach from=$address_words item=word_item name="word_loop"}{if !$smarty.foreach.word_loop.first} {/if}<span class="address_{$word_item|replace:',':''}">{$invoiceAddressFormatedValues[$word_item|replace:',':'']|escape:'htmlall':'UTF-8'}</span>{/foreach}</li>
{/if}
{/foreach}
</ul>
<ul class="address alternate_item" {if $order->isVirtual()}style="display:none;"{/if}>
<li class="address_title">{l s='Delivery'}</li>
{foreach from=$dlv_adr_fields name=dlv_loop item=field_item}
{if $field_item eq "company" && isset($address_delivery->company)}<li class="address_company">{$address_delivery->company|escape:'htmlall':'UTF-8'}</li>
{elseif $field_item eq "address2" && $address_delivery->address2}<li class="address_address2">{$address_delivery->address2|escape:'htmlall':'UTF-8'}</li>
{elseif $field_item eq "phone_mobile" && $address_delivery->phone_mobile}<li class="address_phone_mobile">{$address_delivery->phone_mobile|escape:'htmlall':'UTF-8'}</li>
{else}
{assign var=address_words value=" "|explode:$field_item}
<li>{foreach from=$address_words item=word_item name="word_loop"}{if !$smarty.foreach.word_loop.first} {/if}<span class="address_{$word_item|replace:',':''}">{$deliveryAddressFormatedValues[$word_item|replace:',':'']|escape:'htmlall':'UTF-8'}</span>{/foreach}</li>
{/if}
{/foreach}
</ul>
</div>
{$HOOK_ORDERDETAILDISPLAYED}
{if !$is_guest}<form action="{$link->getPageLink('order-follow', true)|escape:'html'}" method="post">{/if}
<div id="order-detail-content" class="table_block">
<table class="std">
<thead>
<tr>
{if $return_allowed}<th class="first_item"><input type="checkbox" /></th>{/if}
<th class="{if $return_allowed}item{else}first_item{/if}">{l s='Reference'}</th>
<th class="item">{l s='Product'}</th>
<th class="item">{l s='Quantity'}</th>
{if $order->hasProductReturned()}
<th class="item">{l s='Returned'}</th>
{/if}
<th class="item">{l s='Unit price'}</th>
<th class="last_item">{l s='Total price'}</th>
</tr>
</thead>
<tfoot>
{if $priceDisplay && $use_tax}
<tr class="item">
<td colspan="{if $return_allowed || $order->hasProductReturned()}{if $order->hasProductReturned() && $return_allowed}7{else}6{/if}{else}5{/if}">
{l s='Total products (tax excl.)'} <span class="price">{displayWtPriceWithCurrency price=$order->getTotalProductsWithoutTaxes() currency=$currency}</span>
</td>
</tr>
{/if}
<tr class="item">
<td colspan="{if $return_allowed || $order->hasProductReturned()}{if $order->hasProductReturned() && $return_allowed}7{else}6{/if}{else}5{/if}">
{l s='Total products'} {if $use_tax}{l s='(tax incl.)'}{/if}: <span class="price">{displayWtPriceWithCurrency price=$order->getTotalProductsWithTaxes() currency=$currency}</span>
</td>
</tr>
{if $order->total_discounts > 0}
<tr class="item">
<td colspan="{if $return_allowed || $order->hasProductReturned()}{if $order->hasProductReturned() && $return_allowed}7{else}6{/if}{else}5{/if}">
{l s='Total vouchers:'} <span class="price-discount">{displayWtPriceWithCurrency price=$order->total_discounts currency=$currency convert=1}</span>
</td>
</tr>
{/if}
{if $order->total_wrapping > 0}
<tr class="item">
<td colspan="{if $return_allowed || $order->hasProductReturned()}{if $order->hasProductReturned() && $return_allowed}7{else}6{/if}{else}5{/if}">
{l s='Total gift wrapping cost:'} <span class="price-wrapping">{displayWtPriceWithCurrency price=$order->total_wrapping currency=$currency}</span>
</td>
</tr>
{/if}
<tr class="item">
<td colspan="{if $return_allowed || $order->hasProductReturned()}{if $order->hasProductReturned() && $return_allowed}7{else}6{/if}{else}5{/if}">
{l s='Total shipping'} {if $use_tax}{l s='(tax incl.)'}{/if}: <span class="price-shipping">{displayWtPriceWithCurrency price=$order->total_shipping currency=$currency}</span>
</td>
</tr>
<tr class="totalprice item">
<td colspan="{if $return_allowed || $order->hasProductReturned()}{if $order->hasProductReturned() && $return_allowed}7{else}6{/if}{else}5{/if}">
{l s='Total'} <span class="price">{displayWtPriceWithCurrency price=$order->total_paid currency=$currency}</span>
</td>
</tr>
</tfoot>
<tbody>
{foreach from=$products item=product name=products}
{if !isset($product.deleted)}
{assign var='productId' value=$product.product_id}
{assign var='productAttributeId' value=$product.product_attribute_id}
{if isset($product.customizedDatas)}
{assign var='productQuantity' value=$product.product_quantity-$product.customizationQuantityTotal}
{else}
{assign var='productQuantity' value=$product.product_quantity}
{/if}
<!-- Customized products -->
{if isset($product.customizedDatas)}
<tr class="item">
{if $return_allowed}<td class="order_cb"></td>{/if}
<td><label for="cb_{$product.id_order_detail|intval}">{if $product.product_reference}{$product.product_reference|escape:'htmlall':'UTF-8'}{else}--{/if}</label></td>
<td class="bold">
<label for="cb_{$product.id_order_detail|intval}">{$product.product_name|escape:'htmlall':'UTF-8'}</label>
</td>
<td><input class="order_qte_input" name="order_qte_input[{$smarty.foreach.products.index}]" type="text" size="2" value="{$product.customizationQuantityTotal|intval}" /><label for="cb_{$product.id_order_detail|intval}"><span class="order_qte_span editable">{$product.customizationQuantityTotal|intval}</span></label></td>
{if $order->hasProductReturned()}
<td>
{$product['qty_returned']}
</td>
{/if}
<td>
<label class="price" for="cb_{$product.id_order_detail|intval}">
{if $group_use_tax}
{convertPriceWithCurrency price=$product.unit_price_tax_incl currency=$currency}
{else}
{convertPriceWithCurrency price=$product.unit_price_tax_excl currency=$currency}
{/if}
</label>
</td>
<td>
<label class="price" for="cb_{$product.id_order_detail|intval}">
{if isset($customizedDatas.$productId.$productAttributeId)}
{if $group_use_tax}
{convertPriceWithCurrency price=$product.total_customization_wt currency=$currency}
{else}
{convertPriceWithCurrency price=$product.total_customization currency=$currency}
{/if}
{else}
{if $group_use_tax}
{convertPriceWithCurrency price=$product.total_price_tax_incl currency=$currency}
{else}
{convertPriceWithCurrency price=$product.total_price_tax_excl currency=$currency}
{/if}
{/if}
</label>
</td>
</tr>
{foreach $product.customizedDatas as $customizationPerAddress}
{foreach $customizationPerAddress as $customizationId => $customization}
<tr class="alternate_item">
{if $return_allowed}<td class="order_cb"><input type="checkbox" id="cb_{$product.id_order_detail|intval}" name="customization_ids[{$product.id_order_detail|intval}][]" value="{$customizationId|intval}" /></td>{/if}
<td colspan="2">
{foreach from=$customization.datas key='type' item='datas'}
{if $type == $CUSTOMIZE_FILE}
<ul class="customizationUploaded">
{foreach from=$datas item='data'}
<li><img src="{$pic_dir}{$data.value}_small" alt="" class="customizationUploaded" /></li>
{/foreach}
</ul>
{elseif $type == $CUSTOMIZE_TEXTFIELD}
<ul class="typedText">{counter start=0 print=false}
{foreach from=$datas item='data'}
{assign var='customizationFieldName' value="Text #"|cat:$data.id_customization_field}
<li>{$data.name|default:$customizationFieldName} : {$data.value}</li>
{/foreach}
</ul>
{/if}
{/foreach}
</td>
<td>
<input class="order_qte_input" name="customization_qty_input[{$customizationId|intval}]" type="text" size="2" value="{$customization.quantity|intval}" /><label for="cb_{$product.id_order_detail|intval}"><span class="order_qte_span editable">{$customization.quantity|intval}</span></label>
</td>
<td colspan="2"></td>
</tr>
{/foreach}
{/foreach}
{/if}
<!-- Classic products -->
{if $product.product_quantity > $product.customizationQuantityTotal}
<tr class="item">
{if $return_allowed}<td class="order_cb"><input type="checkbox" id="cb_{$product.id_order_detail|intval}" name="ids_order_detail[{$product.id_order_detail|intval}]" value="{$product.id_order_detail|intval}" /></td>{/if}
<td><label for="cb_{$product.id_order_detail|intval}">{if $product.product_reference}{$product.product_reference|escape:'htmlall':'UTF-8'}{else}--{/if}</label></td>
<td class="bold">
<label for="cb_{$product.id_order_detail|intval}">
{if $product.download_hash && $invoice && $product.display_filename != '' && $product.product_quantity_refunded == 0 && $product.product_quantity_return == 0}
{if isset($is_guest) && $is_guest}
<a href="{$link->getPageLink('get-file', true, NULL, "key={$product.filename|escape:'htmlall':'UTF-8'}-{$product.download_hash|escape:'htmlall':'UTF-8'}&amp;id_order={$order->id}&secure_key={$order->secure_key}")|escape:'html'}" title="{l s='Download this product'}">
{else}
<a href="{$link->getPageLink('get-file', true, NULL, "key={$product.filename|escape:'htmlall':'UTF-8'}-{$product.download_hash|escape:'htmlall':'UTF-8'}")|escape:'html'}" title="{l s='Download this product'}">
{/if}
<img src="{$img_dir}icon/download_product.gif" class="icon" alt="{l s='Download product'}" />
</a>
{if isset($is_guest) && $is_guest}
<a href="{$link->getPageLink('get-file', true, NULL, "key={$product.filename|escape:'htmlall':'UTF-8'}-{$product.download_hash|escape:'htmlall':'UTF-8'}&id_order={$order->id}&secure_key={$order->secure_key}")|escape:'html'}" title="{l s='Download this product'}"> {$product.product_name|escape:'htmlall':'UTF-8'} </a>
{else}
<a href="{$link->getPageLink('get-file', true, NULL, "key={$product.filename|escape:'htmlall':'UTF-8'}-{$product.download_hash|escape:'htmlall':'UTF-8'}")|escape:'html'}" title="{l s='Download this product'}"> {$product.product_name|escape:'htmlall':'UTF-8'} </a>
{/if}
{else}
{$product.product_name|escape:'htmlall':'UTF-8'}
{/if}
</label>
</td>
<td><input class="order_qte_input" name="order_qte_input[{$product.id_order_detail|intval}]" type="text" size="2" value="{$productQuantity|intval}" /><label for="cb_{$product.id_order_detail|intval}"><span class="order_qte_span editable">{$productQuantity|intval}</span></label></td>
{if $order->hasProductReturned()}
<td>
{$product['qty_returned']}
</td>
{/if}
<td>
<label class="price" for="cb_{$product.id_order_detail|intval}">
{if $group_use_tax}
{convertPriceWithCurrency price=$product.unit_price_tax_incl currency=$currency}
{else}
{convertPriceWithCurrency price=$product.unit_price_tax_excl currency=$currency}
{/if}
</label>
</td>
<td>
<label class="price" for="cb_{$product.id_order_detail|intval}">
{if $group_use_tax}
{convertPriceWithCurrency price=$product.total_price_tax_incl currency=$currency}
{else}
{convertPriceWithCurrency price=$product.total_price_tax_excl currency=$currency}
{/if}
</label>
</td>
</tr>
{/if}
{/if}
{/foreach}
{foreach from=$discounts item=discount}
<tr class="item">
<td>{$discount.name|escape:'htmlall':'UTF-8'}</td>
<td>{l s='Voucher'} {$discount.name|escape:'htmlall':'UTF-8'}</td>
<td><span class="order_qte_span editable">1</span></td>
<td>&nbsp;</td>
<td>{if $discount.value != 0.00}-{/if}{convertPriceWithCurrency price=$discount.value currency=$currency}</td>
{if $return_allowed}
<td>&nbsp;</td>
{/if}
</tr>
{/foreach}
</tbody>
</table>
</div>
{if $return_allowed}
<div id="returnOrderMessage">
<h3>{l s='Merchandise return'}</h3>
<p>{l s='If you wish to return one or more products, please mark the corresponding boxes and provide an explanation for the return. When complete, click the button below.'}</p>
<p class="textarea">
<textarea cols="67" rows="3" name="returnText"></textarea>
</p>
<p class="submit">
<input type="submit" value="{l s='Make an RMA slip'}" name="submitReturnMerchandise" class="button_large" />
<input type="hidden" class="hidden" value="{$order->id|intval}" name="id_order" />
</p>
</div>
<br />
{/if}
</form>
<div class="table_block">
{if $order->getShipping()|count > 0}
<table class="std">
<thead>
<tr>
<th class="first_item">{l s='Date'}</th>
<th class="item">{l s='Carrier'}</th>
<th class="item">{l s='Weight'}</th>
<th class="item">{l s='Shipping cost'}</th>
<th class="last_item">{l s='Tracking number'}</th>
</tr>
</thead>
<tbody>
{foreach from=$order->getShipping() item=line}
<tr class="item">
<td>{dateFormat date=$line.date_add full=0}</td>
<td>{$line.carrier_name}</td>
<td>{if $line.weight > 0}{$line.weight|string_format:"%.3f"} {Configuration::get('PS_WEIGHT_UNIT')}{else}-{/if}</td>
<td>{if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_INC}{displayPrice price=$line.shipping_cost_tax_incl currency=$currency->id}{else}{displayPrice price=$line.shipping_cost_tax_excl currency=$currency->id}{/if}</td>
<td>
<span id="shipping_number_show">{if $line.tracking_number}{if $line.url && $line.tracking_number}<a href="{$line.url|replace:'@':$line.tracking_number}">{$line.tracking_number}</a>{else}{$line.tracking_number}{/if}{else}-{/if}</span>
</td>
</tr>
{/foreach}
</tbody>
</table>
{/if}
</div>
<br />
{if !$is_guest}
{if count($messages)}
<h3>{l s='Messages'}</h3>
<div class="table_block">
<table class="detail_step_by_step std">
<thead>
<tr>
<th class="first_item" style="width:150px;">{l s='From'}</th>
<th class="last_item">{l s='Message'}</th>
</tr>
</thead>
<tbody>
{foreach from=$messages item=message name="messageList"}
<tr class="{if $smarty.foreach.messageList.first}first_item{elseif $smarty.foreach.messageList.last}last_item{/if} {if $smarty.foreach.messageList.index % 2}alternate_item{else}item{/if}">
<td>
{if isset($message.elastname) && $message.elastname}
{$message.efirstname|escape:'htmlall':'UTF-8'} {$message.elastname|escape:'htmlall':'UTF-8'}
{elseif $message.clastname}
{$message.cfirstname|escape:'htmlall':'UTF-8'} {$message.clastname|escape:'htmlall':'UTF-8'}
{else}
<b>{$shop_name|escape:'htmlall':'UTF-8'}</b>
{/if}
<br />
{dateFormat date=$message.date_add full=1}
</td>
<td>{$message.message|escape:'htmlall':'UTF-8'|nl2br}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{/if}
{if isset($errors) && $errors}
<div class="error">
<p>{if $errors|@count > 1}{l s='There are %d errors' sprintf=$errors|@count}{else}{l s='There is %d error' sprintf=$errors|@count}{/if}</p>
<ol>
{foreach from=$errors key=k item=error}
<li>{$error}</li>
{/foreach}
</ol>
</div>
{/if}
{if isset($message_confirmation) && $message_confirmation}
<p class="success">
{l s='Message successfully sent'}
</p>
{/if}
<form action="{$link->getPageLink('order-detail', true)|escape:'html'}" method="post" class="std" id="sendOrderMessage">
<h3>{l s='Add a message'}</h3>
<p>{l s='If you would like to add a comment about your order, please write it in the field below.'}</p>
<p>
<label for="id_product">{l s='Product'}</label>
<select name="id_product" style="width:300px;">
<option value="0">{l s='-- Choose --'}</option>
{foreach from=$products item=product name=products}
<option value="{$product.product_id}">{$product.product_name}</option>
{/foreach}
</select>
</p>
<p class="textarea">
<textarea cols="67" rows="3" name="msgText"></textarea>
</p>
<p class="submit">
<input type="hidden" name="id_order" value="{$order->id|intval}" />
<input type="submit" class="button" name="submitMessage" value="{l s='Send'}"/>
</p>
</form>
{else}
<p><img src="{$img_dir}icon/infos.gif" alt="" class="icon" />&nbsp;{l s='You cannot return merchandise with a guest account'}</p>
{/if}
{/if}
+428
View File
@@ -0,0 +1,428 @@
<div id="opc_new_account" class="opc-main-block">
<div id="opc_new_account-overlay" class="opc-overlay" style="display: none;"></div>
<h2><span>1</span> {l s='Account'}</h2>
<form action="{$link->getPageLink('authentication', true, NULL, "back=order-opc")|escape:'html'}" method="post" id="login_form" class="std">
<fieldset>
<h3>{l s='Already registered?'}</h3>
<p><a href="#" id="openLoginFormBlock">&raquo; {l s='Click here'}</a></p>
<div id="login_form_content" style="display:none;">
<!-- Error return block -->
<div id="opc_login_errors" class="error" style="display:none;"></div>
<!-- END Error return block -->
<div style="margin-left:40px;margin-bottom:5px;float:left;width:40%;">
<label for="login_email">{l s='Email address'}</label>
<span><input type="text" id="login_email" name="email" /></span>
</div>
<div style="margin-left:40px;margin-bottom:5px;float:left;width:40%;">
<label for="login_passwd">{l s='Password'}</label>
<span><input type="password" id="login_passwd" name="login_passwd" /></span>
<a href="{$link->getPageLink('password', true)|escape:'html'}" class="lost_password">{l s='Forgot your password?'}</a>
</div>
<p class="submit">
{if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back|escape:'htmlall':'UTF-8'}" />{/if}
<input type="submit" id="SubmitLogin" name="SubmitLogin" class="button" value="{l s='Login'}" />
</p>
</div>
</fieldset>
</form>
<form action="javascript:;" method="post" id="new_account_form" class="std" autocomplete="on" autofill="on">
<fieldset>
<h3 id="new_account_title">{l s='New Customer'}</h3>
<div id="opc_account_choice">
<div class="opc_float">
<p class="title_block">{l s='Instant Checkout'}</p>
<p>
<input type="button" class="exclusive_large" id="opc_guestCheckout" value="{l s='Guest checkout'}" />
</p>
</div>
<div class="opc_float">
<p class="title_block">{l s='Create your account today and enjoy:'}</p>
<ul class="bullet">
<li>{l s='Personalized and secure access'}</li>
<li>{l s='A fast and easy check out process'}</li>
<li>{l s='Separate billing and shipping addresses'}</li>
</ul>
<p>
<input type="button" class="button_large" id="opc_createAccount" value="{l s='Create an account'}" />
</p>
</div>
<div class="clear"></div>
</div>
<div id="opc_account_form">
{$HOOK_CREATE_ACCOUNT_TOP}
<script type="text/javascript">
// <![CDATA[
idSelectedCountry = {if isset($guestInformations) && $guestInformations.id_state}{$guestInformations.id_state|intval}{else}false{/if};
{if isset($countries)}
{foreach from=$countries item='country'}
{if isset($country.states) && $country.contains_states}
countries[{$country.id_country|intval}] = new Array();
{foreach from=$country.states item='state' name='states'}
countries[{$country.id_country|intval}].push({ldelim}'id' : '{$state.id_state}', 'name' : '{$state.name|escape:'htmlall':'UTF-8'}'{rdelim});
{/foreach}
{/if}
{if $country.need_identification_number}
countriesNeedIDNumber.push({$country.id_country|intval});
{/if}
{if isset($country.need_zip_code)}
countriesNeedZipCode[{$country.id_country|intval}] = {$country.need_zip_code};
{/if}
{/foreach}
{/if}
//]]>
{literal}
function vat_number()
{
if (($('#company').length) && ($('#company').val() != ''))
$('#vat_number_block').show();
else
$('#vat_number_block').hide();
}
function vat_number_invoice()
{
if (($('#company_invoice').length) && ($('#company_invoice').val() != ''))
$('#vat_number_block_invoice').show();
else
$('#vat_number_block_invoice').hide();
}
$(document).ready(function() {
$('#company').on('input',function(){
vat_number();
});
$('#company_invoice').on('input',function(){
vat_number_invoice();
});
vat_number();
vat_number_invoice();
{/literal}
$('.id_state option[value={if isset($guestInformations.id_state)}{$guestInformations.id_state|intval}{/if}]').prop('selected', true);
$('.id_state_invoice option[value={if isset($guestInformations.id_state_invoice)}{$guestInformations.id_state_invoice|intval}{/if}]').prop('selected', true);
{literal}
});
{/literal}
</script>
<!-- Error return block -->
<div id="opc_account_errors" class="error" style="display:none;"></div>
<!-- END Error return block -->
<!-- Account -->
<input type="hidden" id="is_new_customer" name="is_new_customer" value="0" />
<input type="hidden" id="opc_id_customer" name="opc_id_customer" value="{if isset($guestInformations) && $guestInformations.id_customer}{$guestInformations.id_customer}{else}0{/if}" />
<input type="hidden" id="opc_id_address_delivery" name="opc_id_address_delivery" value="{if isset($guestInformations) && $guestInformations.id_address_delivery}{$guestInformations.id_address_delivery}{else}0{/if}" />
<input type="hidden" id="opc_id_address_invoice" name="opc_id_address_invoice" value="{if isset($guestInformations) && $guestInformations.id_address_delivery}{$guestInformations.id_address_delivery}{else}0{/if}" />
<p class="required text">
<label for="email">{l s='Email'} <sup>*</sup></label>
<input type="text" class="text" id="email" name="email" value="{if isset($guestInformations) && $guestInformations.email}{$guestInformations.email}{/if}" />
</p>
<p class="required password is_customer_param">
<label for="passwd">{l s='Password'} <sup>*</sup></label>
<input type="password" class="text" name="passwd" id="passwd" />
<span class="form_info">{l s='(five characters min.)'}</span>
</p>
<p class="radio required">
<span>{l s='Title'}</span>
{foreach from=$genders key=k item=gender}
<input type="radio" name="id_gender" id="id_gender{$gender->id_gender}" value="{$gender->id_gender}" {if isset($smarty.post.id_gender) && $smarty.post.id_gender == $gender->id_gender}checked="checked"{/if} />
<label for="id_gender{$gender->id_gender}" class="top">{$gender->name}</label>
{/foreach}
</p>
<p class="required text">
<label for="firstname">{l s='First name'} <sup>*</sup></label>
<input type="text" class="text" id="customer_firstname" name="customer_firstname" onblur="$('#firstname').val($(this).val());" value="{if isset($guestInformations) && $guestInformations.customer_firstname}{$guestInformations.customer_firstname}{/if}" />
</p>
<p class="required text">
<label for="lastname">{l s='Last name'} <sup>*</sup></label>
<input type="text" class="text" id="customer_lastname" name="customer_lastname" onblur="$('#lastname').val($(this).val());" value="{if isset($guestInformations) && $guestInformations.customer_lastname}{$guestInformations.customer_lastname}{/if}" />
</p>
<p class="select">
<span>{l s='Date of Birth'}</span>
<select id="days" name="days">
<option value="">-</option>
{foreach from=$days item=day}
<option value="{$day|escape:'htmlall':'UTF-8'}" {if isset($guestInformations) && ($guestInformations.sl_day == $day)} selected="selected"{/if}>{$day|escape:'htmlall':'UTF-8'}&nbsp;&nbsp;</option>
{/foreach}
</select>
{*
{l s='January'}
{l s='February'}
{l s='March'}
{l s='April'}
{l s='May'}
{l s='June'}
{l s='July'}
{l s='August'}
{l s='September'}
{l s='October'}
{l s='November'}
{l s='December'}
*}
<select id="months" name="months">
<option value="">-</option>
{foreach from=$months key=k item=month}
<option value="{$k|escape:'htmlall':'UTF-8'}" {if isset($guestInformations) && ($guestInformations.sl_month == $k)} selected="selected"{/if}>{l s=$month}&nbsp;</option>
{/foreach}
</select>
<select id="years" name="years">
<option value="">-</option>
{foreach from=$years item=year}
<option value="{$year|escape:'htmlall':'UTF-8'}" {if isset($guestInformations) && ($guestInformations.sl_year == $year)} selected="selected"{/if}>{$year|escape:'htmlall':'UTF-8'}&nbsp;&nbsp;</option>
{/foreach}
</select>
</p>
{if isset($newsletter) && $newsletter}
<p class="checkbox">
<input type="checkbox" name="newsletter" id="newsletter" value="1" {if isset($guestInformations) && $guestInformations.newsletter}checked="checked"{/if} autocomplete="off"/>
<label for="newsletter">{l s='Sign up for our newsletter!'}</label>
</p>
<p class="checkbox" >
<input type="checkbox"name="optin" id="optin" value="1" {if isset($guestInformations) && $guestInformations.optin}checked="checked"{/if} autocomplete="off"/>
<label for="optin">{l s='Receive special offers from our partners!'}</label>
</p>
{/if}
<h3>{l s='Delivery address'}</h3>
{$stateExist = false}
{$postCodeExist = false}
{$dniExist = false}
{foreach from=$dlv_all_fields item=field_name}
{if $field_name eq "company" && $b2b_enable}
<p class="text">
<label for="company">{l s='Company'}</label>
<input type="text" class="text" id="company" name="company" value="{if isset($guestInformations) && $guestInformations.company}{$guestInformations.company}{/if}" />
</p>
{elseif $field_name eq "vat_number"}
<div id="vat_number_block" style="display:none;">
<p class="text">
<label for="vat_number">{l s='VAT number'}</label>
<input type="text" class="text" name="vat_number" id="vat_number" value="{if isset($guestInformations) && $guestInformations.vat_number}{$guestInformations.vat_number}{/if}" />
</p>
</div>
{elseif $field_name eq "dni"}
{assign var='dniExist' value=true}
<p class="text">
<label for="dni">{l s='Identification number'}</label>
<input type="text" class="text" name="dni" id="dni" value="{if isset($guestInformations) && $guestInformations.dni}{$guestInformations.dni}{/if}" />
<span class="form_info">{l s='DNI / NIF / NIE'}</span>
</p>
{elseif $field_name eq "firstname"}
<p class="required text">
<label for="firstname">{l s='First name'} <sup>*</sup></label>
<input type="text" class="text" id="firstname" name="firstname" value="{if isset($guestInformations) && $guestInformations.firstname}{$guestInformations.firstname}{/if}" />
</p>
{elseif $field_name eq "lastname"}
<p class="required text">
<label for="lastname">{l s='Last name'} <sup>*</sup></label>
<input type="text" class="text" id="lastname" name="lastname" value="{if isset($guestInformations) && $guestInformations.lastname}{$guestInformations.lastname}{/if}" />
</p>
{elseif $field_name eq "address1"}
<p class="required text">
<label for="address1">{l s='Address'} <sup>*</sup></label>
<input type="text" class="text" name="address1" id="address1" value="{if isset($guestInformations) && $guestInformations.address1}{$guestInformations.address1}{/if}" />
</p>
{elseif $field_name eq "address2"}
<p class="text is_customer_param">
<label for="address2">{l s='Address (Line 2)'}</label>
<input type="text" class="text" name="address2" id="address2" value="{if isset($guestInformations) && $guestInformations.address2}{$guestInformations.address2}{/if}" />
</p>
{elseif $field_name eq "postcode"}
{$postCodeExist = true}
<p class="required postcode text">
<label for="postcode">{l s='Zip / Postal code'} <sup>*</sup></label>
<input type="text" class="text" name="postcode" id="postcode" value="{if isset($guestInformations) && $guestInformations.postcode}{$guestInformations.postcode}{/if}" onkeyup="$('#postcode').val($('#postcode').val().toUpperCase());" />
</p>
{elseif $field_name eq "city"}
<p class="required text">
<label for="city">{l s='City'} <sup>*</sup></label>
<input type="text" class="text" name="city" id="city" value="{if isset($guestInformations) && $guestInformations.city}{$guestInformations.city}{/if}" />
</p>
{elseif $field_name eq "country" || $field_name eq "Country:name"}
<p class="required select">
<label for="id_country">{l s='Country'} <sup>*</sup></label>
<select name="id_country" id="id_country">
{foreach from=$countries item=v}
<option value="{$v.id_country}"{if (isset($guestInformations) AND $guestInformations.id_country == $v.id_country) OR (!isset($guestInformations) && $sl_country == $v.id_country)} selected="selected"{/if}>{$v.name|escape:'htmlall':'UTF-8'}</option>
{/foreach}
</select>
</p>
{elseif $field_name eq "state" || $field_name eq 'State:name'}
{$stateExist = true}
<p class="required id_state select" style="display:none;">
<label for="id_state">{l s='State'} <sup>*</sup></label>
<select name="id_state" id="id_state">
<option value="">-</option>
</select>
</p>
{/if}
{/foreach}
{if !$postCodeExist}
<p class="required postcode text hidden">
<label for="postcode">{l s='Zip / Postal code'} <sup>*</sup></label>
<input type="text" class="text" name="postcode" id="postcode" value="{if isset($guestInformations) && $guestInformations.postcode}{$guestInformations.postcode}{/if}" onkeyup="$('#postcode').val($('#postcode').val().toUpperCase());" />
</p>
{/if}
{if !$stateExist}
<p class="required id_state select hidden">
<label for="id_state">{l s='State'} <sup>*</sup></label>
<select name="id_state" id="id_state">
<option value="">-</option>
</select>
</p>
{/if}
{if !$dniExist}
<p class="required text dni">
<label for="dni">{l s='Identification number'} <sup>*</sup></label>
<input type="text" class="text" name="dni" id="dni" value="{if isset($guestInformations) && $guestInformations.dni}{$guestInformations.dni}{/if}" />
<span class="form_info">{l s='DNI / NIF / NIE'}</span>
</p>
{/if}
<p class="textarea is_customer_param">
<label for="other">{l s='Additional information'}</label>
<textarea name="other" id="other" cols="26" rows="3"></textarea>
</p>
{if isset($one_phone_at_least) && $one_phone_at_least}
<p class="inline-infos required is_customer_param">{l s='You must register at least one phone number.'}</p>
{/if}
<p class="text is_customer_param">
<label for="phone">{l s='Home phone'}</label>
<input type="text" class="text" name="phone" id="phone" value="{if isset($guestInformations) && $guestInformations.phone}{$guestInformations.phone}{/if}" />
</p>
<p class="{if isset($one_phone_at_least) && $one_phone_at_least}required {/if}text">
<label for="phone_mobile">{l s='Mobile phone'}{if isset($one_phone_at_least) && $one_phone_at_least} <sup>*</sup>{/if}</label>
<input type="text" class="text" name="phone_mobile" id="phone_mobile" value="{if isset($guestInformations) && $guestInformations.phone_mobile}{$guestInformations.phone_mobile}{/if}" />
</p>
<input type="hidden" name="alias" id="alias" value="{l s='My address'}"/>
<p class="checkbox">
<input type="checkbox" name="invoice_address" id="invoice_address"{if (isset($smarty.post.invoice_address) && $smarty.post.invoice_address) || (isset($guestInformations) && $guestInformations.invoice_address)} checked="checked"{/if} autocomplete="off"/>
<label for="invoice_address"><b>{l s='Please use another address for invoice'}</b></label>
</p>
<div id="opc_invoice_address" class="is_customer_param">
{assign var=stateExist value=false}
{assign var=postCodeExist value=false}
{assign var=dniExist value=false}
<h3>{l s='Invoice address'}</h3>
{foreach from=$inv_all_fields item=field_name}
{if $field_name eq "company" && $b2b_enable}
<p class="text">
<label for="company_invoice">{l s='Company'}</label>
<input type="text" class="text" id="company_invoice" name="company_invoice" value="" />
</p>
{elseif $field_name eq "vat_number"}
<div id="vat_number_block_invoice" class="is_customer_param" style="display:none;">
<p class="text">
<label for="vat_number_invoice">{l s='VAT number'}</label>
<input type="text" class="text" id="vat_number_invoice" name="vat_number_invoice" value="" />
</p>
</div>
{elseif $field_name eq "dni"}
{assign var='dniExist' value=true}
<p class="text">
<label for="dni_invoice">{l s='Identification number'}</label>
<input type="text" class="text" name="dni_invoice" id="dni_invoice" value="{if isset($guestInformations) && $guestInformations.dni_invoice}{$guestInformations.dni_invoice}{/if}" />
<span class="form_info">{l s='DNI / NIF / NIE'}</span>
</p>
{elseif $field_name eq "firstname"}
<p class="required text">
<label for="firstname_invoice">{l s='First name'} <sup>*</sup></label>
<input type="text" class="text" id="firstname_invoice" name="firstname_invoice" value="{if isset($guestInformations) && $guestInformations.firstname_invoice}{$guestInformations.firstname_invoice}{/if}" />
</p>
{elseif $field_name eq "lastname"}
<p class="required text">
<label for="lastname_invoice">{l s='Last name'} <sup>*</sup></label>
<input type="text" class="text" id="lastname_invoice" name="lastname_invoice" value="{if isset($guestInformations) && $guestInformations.lastname_invoice}{$guestInformations.lastname_invoice}{/if}" />
</p>
{elseif $field_name eq "address1"}
<p class="required text">
<label for="address1_invoice">{l s='Address'} <sup>*</sup></label>
<input type="text" class="text" name="address1_invoice" id="address1_invoice" value="{if isset($guestInformations) && $guestInformations.address1_invoice}{$guestInformations.address1_invoice}{/if}" />
</p>
{elseif $field_name eq "address2"}
<p class="text is_customer_param">
<label for="address2_invoice">{l s='Address (Line 2)'}</label>
<input type="text" class="text" name="address2_invoice" id="address2_invoice" value="{if isset($guestInformations) && $guestInformations.address2_invoice}{$guestInformations.address2_invoice}{/if}" />
</p>
{elseif $field_name eq "postcode"}
{$postCodeExist = true}
<p class="required postcode_invoice text">
<label for="postcode_invoice">{l s='Zip / Postal Code'} <sup>*</sup></label>
<input type="text" class="text" name="postcode_invoice" id="postcode_invoice" value="{if isset($guestInformations) && $guestInformations.postcode_invoice}{$guestInformations.postcode_invoice}{/if}" onkeyup="$('#postcode_invoice').val($('#postcode_invoice').val().toUpperCase());" />
</p>
{elseif $field_name eq "city"}
<p class="required text">
<label for="city_invoice">{l s='City'} <sup>*</sup></label>
<input type="text" class="text" name="city_invoice" id="city_invoice" value="{if isset($guestInformations) && $guestInformations.city_invoice}{$guestInformations.city_invoice}{/if}" />
</p>
{elseif $field_name eq "country" || $field_name eq "Country:name"}
<p class="required select">
<label for="id_country_invoice">{l s='Country'} <sup>*</sup></label>
<select name="id_country_invoice" id="id_country_invoice">
<option value="">-</option>
{foreach from=$countries item=v}
<option value="{$v.id_country}"{if (isset($guestInformations) AND $guestInformations.id_country_invoice == $v.id_country) OR (!isset($guestInformations) && $sl_country == $v.id_country)} selected="selected"{/if}>{$v.name|escape:'htmlall':'UTF-8'}</option>
{/foreach}
</select>
</p>
{elseif $field_name eq "state" || $field_name eq 'State:name'}
{$stateExist = true}
<p class="required id_state_invoice select" style="display:none;">
<label for="id_state_invoice">{l s='State'} <sup>*</sup></label>
<select name="id_state_invoice" id="id_state_invoice">
<option value="">-</option>
</select>
</p>
{/if}
{/foreach}
{if !$postCodeExist}
<p class="required postcode_invoice text hidden">
<label for="postcode_invoice">{l s='Zip / Postal Code'} <sup>*</sup></label>
<input type="text" class="text" name="postcode_invoice" id="postcode_invoice" value="" onkeyup="$('#postcode').val($('#postcode').val().toUpperCase());" />
</p>
{/if}
{if !$stateExist}
<p class="required id_state_invoice select hidden">
<label for="id_state_invoice">{l s='State'} <sup>*</sup></label>
<select name="id_state_invoice" id="id_state_invoice">
<option value="">-</option>
</select>
</p>
{/if}
{if !$dniExist}
<p class="required text dni_invoice">
<label for="dni_invoice">{l s='Identification number'} <sup>*</sup></label>
<input type="text" class="text" name="dni_invoice" id="dni_invoice" value="{if isset($guestInformations) && $guestInformations.dni_invoice}{$guestInformations.dni_invoice}{/if}" />
<span class="form_info">{l s='DNI / NIF / NIE'}</span>
</p>
{/if}
<p class="textarea is_customer_param">
<label for="other_invoice">{l s='Additional information'}</label>
<textarea name="other_invoice" id="other_invoice" cols="26" rows="3"></textarea>
</p>
{if isset($one_phone_at_least) && $one_phone_at_least}
<p class="inline-infos required is_customer_param">{l s='You must register at least one phone number.'}</p>
{/if}
<p class="text is_customer_param">
<label for="phone_invoice">{l s='Home phone'}</label>
<input type="text" class="text" name="phone_invoice" id="phone_invoice" value="{if isset($guestInformations) && $guestInformations.phone_invoice}{$guestInformations.phone_invoice}{/if}" />
</p>
<p class="{if isset($one_phone_at_least) && $one_phone_at_least}required {/if}text">
<label for="phone_mobile_invoice">{l s='Mobile phone'}{if isset($one_phone_at_least) && $one_phone_at_least} <sup>*</sup>{/if}</label>
<input type="text" class="text" name="phone_mobile_invoice" id="phone_mobile_invoice" value="{if isset($guestInformations) && $guestInformations.phone_mobile_invoice}{$guestInformations.phone_mobile_invoice}{/if}" />
</p>
<input type="hidden" name="alias_invoice" id="alias_invoice" value="{l s='My Invoice address'}" />
</div>
{$HOOK_CREATE_ACCOUNT_FORM}
<p class="submit">
<input type="submit" class="exclusive button" name="submitAccount" id="submitAccount" value="{l s='Save'}" />
</p>
<p style="display: none;" id="opc_account_saved">
{l s='Account information saved successfully'}
</p>
<p class="required opc-required" style="clear: both;">
<sup>*</sup>{l s='Required field'}
</p>
<!-- END Account -->
</div>
</fieldset>
</form>
<div class="clear"></div>
</div>
+647
View File
@@ -0,0 +1,647 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{include file="$tpl_dir./errors.tpl"}
{if $errors|@count == 0}
<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};
var jqZoomEnabled = {if $jqZoomEnabled}true{else}false{/if};
//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 productBasePriceTaxExcluded = {$product->base_price} - {$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|floatval}{else}0{/if};
var specific_price = {if $product->specificPrice AND $product->specificPrice.price}{$product->specificPrice.price}{else}0{/if};
var product_specific_price = new Array();
{foreach from=$product->specificPrice key='key_specific_price' item='specific_price_value'}
product_specific_price['{$key_specific_price}'] = '{$specific_price_value}';
{/foreach}
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};
var stock_management = {$stock_management|intval};
{if !isset($priceDisplayPrecision)}
{assign var='priceDisplayPrecision' value=2}
{/if}
{if !$priceDisplay || $priceDisplay == 2}
{assign var='productPrice' value=$product->getPrice(true, $smarty.const.NULL, $priceDisplayPrecision)}
{assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)}
{elseif $priceDisplay == 1}
{assign var='productPrice' value=$product->getPrice(false, $smarty.const.NULL, $priceDisplayPrecision)}
{assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)}
{/if}
var productPriceWithoutReduction = '{$productPriceWithoutReduction}';
var productPrice = '{$productPrice}';
// 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='This combination does not exist for this product. Please select another combination.' js=1}';
var doesntExistNoMore = '{l s='This product is no longer in stock' js=1}';
var doesntExistNoMoreBut = '{l s='with those attributes but is available with others.' js=1}';
var uploading_in_progress = '{l s='Uploading in progress, please be patient.' js=1}';
var fieldRequired = '{l s='Please fill in all the required fields before saving your customization.' js=1}';
{if isset($groups)}
// Combinations
{foreach from=$combinations key=idCombination item=combination}
var specific_price_combination = new Array();
var available_date = new Array();
specific_price_combination['reduction_percent'] = {if $combination.specific_price AND $combination.specific_price.reduction AND $combination.specific_price.reduction_type == 'percentage'}{$combination.specific_price.reduction*100}{else}0{/if};
specific_price_combination['reduction_price'] = {if $combination.specific_price AND $combination.specific_price.reduction AND $combination.specific_price.reduction_type == 'amount'}{$combination.specific_price.reduction}{else}0{/if};
specific_price_combination['price'] = {if $combination.specific_price AND $combination.specific_price.price}{$combination.specific_price.price}{else}0{/if};
specific_price_combination['reduction_type'] = '{if $combination.specific_price}{$combination.specific_price.reduction_type}{/if}';
specific_price_combination['id_product_attribute'] = {if $combination.specific_price}{$combination.specific_price.id_product_attribute|intval}{else}0{/if};
available_date['date'] = '{$combination.available_date}';
available_date['date_formatted'] = '{dateFormat date=$combination.available_date full=false}';
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}, available_date, specific_price_combination);
{/foreach}
{/if}
{if isset($attributesCombinations)}
// Combinations attributes informations
var attributesCombinations = new Array();
{foreach from=$attributesCombinations key=id item=aC}
tabInfos = new Array();
tabInfos['id_attribute'] = '{$aC.id_attribute|intval}';
tabInfos['attribute'] = '{$aC.attribute}';
tabInfos['group'] = '{$aC.group}';
tabInfos['id_attribute_group'] = '{$aC.id_attribute_group|intval}';
attributesCombinations.push(tabInfos);
{/foreach}
{/if}
//]]>
</script>
{include file="$tpl_dir./breadcrumb.tpl"}
<div id="primary_block" class="clearfix">
{if isset($adminActionDisplay) && $adminActionDisplay}
<div id="admin-action">
<p>{l s='This product is not visible to your customers.'}
<input type="hidden" id="admin-action-product-id" value="{$product->id}" />
<input type="submit" value="{l s='Publish'}" class="exclusive" onclick="submitPublishProduct('{$base_dir}{$smarty.get.ad|escape:'htmlall':'UTF-8'}', 0, '{$smarty.get.adtoken|escape:'htmlall':'UTF-8'}')"/>
<input type="submit" value="{l s='Back'}" class="exclusive" onclick="submitPublishProduct('{$base_dir}{$smarty.get.ad|escape:'htmlall':'UTF-8'}', 1, '{$smarty.get.adtoken|escape:'htmlall':'UTF-8'}')"/>
</p>
<p id="admin-action-result"></p>
</p>
</div>
{/if}
{if isset($confirmation) && $confirmation}
<p class="confirmation">
{$confirmation}
</p>
{/if}
<!-- right infos-->
<div id="pb-right-column">
<!-- product img-->
<div id="image-block">
{if $have_image}
<span id="view_full_size">
<img src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large_default')|escape:'html'}"{if $jqZoomEnabled && $have_image} class="jqzoom"{/if} title="{if !empty($cover.legend)}{$cover.legend|escape:'htmlall':'UTF-8'}{else}{$product->name|escape:'htmlall':'UTF-8'}{/if}" alt="{if !empty($cover.legend)}{$cover.legend|escape:'htmlall':'UTF-8'}{else}{$product->name|escape:'htmlall':'UTF-8'}{/if}" id="bigpic" width="{$largeSize.width}" height="{$largeSize.height}"/>
<span class="span_link">{l s='Maximize'}</span>
</span>
{else}
<span id="view_full_size">
<img src="{$img_prod_dir}{$lang_iso}-default-large_default.jpg" id="bigpic" alt="" title="{$product->name|escape:'htmlall':'UTF-8'}" width="{$largeSize.width}" height="{$largeSize.height}" />
<span class="span_link">{l s='Maximize'}</span>
</span>
{/if}
</div>
{if isset($images) && count($images) > 0}
<!-- thumbnails -->
<div id="views_block" class="clearfix {if isset($images) && count($images) < 2}hidden{/if}">
{if isset($images) && count($images) > 3}<span class="view_scroll_spacer"><a id="view_scroll_left" class="hidden" title="{l s='Other views'}" href="javascript:{ldelim}{rdelim}">{l s='Previous'}</a></span>{/if}
<div id="thumbs_list">
<ul id="thumbs_list_frame">
{if isset($images)}
{foreach from=$images item=image name=thumbnails}
{assign var=imageIds value="`$product->id`-`$image.id_image`"}
{if !empty($image.legend)}
{assign var=imageTitlte value=$image.legend|escape:'htmlall':'UTF-8'}
{else}
{assign var=imageTitlte value=$product->name|escape:'htmlall':'UTF-8'}
{/if}
<li id="thumbnail_{$image.id_image}">
<a href="{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox_default')|escape:'html'}" rel="other-views" class="thickbox{if $smarty.foreach.thumbnails.first} shown{/if}" title="{$imageTitlte}">
<img id="thumb_{$image.id_image}" src="{$link->getImageLink($product->link_rewrite, $imageIds, 'medium_default')|escape:'html'}" alt="{$imageTitlte}" title="{$imageTitlte}" height="{$mediumSize.height}" width="{$mediumSize.width}" />
</a>
</li>
{/foreach}
{/if}
</ul>
</div>
{if isset($images) && count($images) > 3}<a id="view_scroll_right" title="{l s='Other views'}" href="javascript:{ldelim}{rdelim}">{l s='Next'}</a>{/if}
</div>
{/if}
{if isset($images) && count($images) > 1}<p class="resetimg clear"><span id="wrapResetImages" style="display: none;"><img src="{$img_dir}icon/cancel_11x13.gif" alt="{l s='Cancel'}" width="11" height="13"/> <a id="resetImages" href="{$link->getProductLink($product)|escape:'html'}" onclick="$('span#wrapResetImages').hide('slow');return (false);">{l s='Display all pictures'}</a></span></p>{/if}
<!-- usefull links-->
<ul id="usefull_link_block">
{if $HOOK_EXTRA_LEFT}{$HOOK_EXTRA_LEFT}{/if}
<li class="print"><a href="javascript:print();">{l s='Print'}</a></li>
{if $have_image && !$jqZoomEnabled}
{/if}
</ul>
</div>
<!-- left infos-->
<div id="pb-left-column">
<h1>{$product->name|escape:'htmlall':'UTF-8'}</h1>
{if $product->description_short OR $packItems|@count > 0}
<div id="short_description_block">
{if $product->description_short}
<div id="short_description_content" class="rte align_justify">{$product->description_short}</div>
{/if}
{if $product->description}
<p class="buttons_bottom_block"><a href="javascript:{ldelim}{rdelim}" class="button">{l s='More details'}</a></p>
{/if}
{if $packItems|@count > 0}
<div class="short_description_pack">
<h3>{l s='Pack content'}</h3>
{foreach from=$packItems item=packItem}
<div class="pack_content">
{$packItem.pack_quantity} x <a href="{$link->getProductLink($packItem.id_product, $packItem.link_rewrite, $packItem.category)|escape:'html'}">{$packItem.name|escape:'htmlall':'UTF-8'}</a>
<p>{$packItem.description_short}</p>
</div>
{/foreach}
</div>
{/if}
</div>
{/if}
{*{if isset($colors) && $colors}
<!-- colors -->
<div id="color_picker">
<p>{l s='Pick a color:' js=1}</p>
<div class="clear"></div>
<ul id="color_to_pick_list" class="clearfix">
{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')|escape:'html'}" 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>
<div class="product_attributes">
{if isset($groups)}
<!-- attributes -->
<div id="attributes">
<div class="clear"></div>
{foreach from=$groups key=id_attribute_group item=group}
{if $group.attributes|@count}
<fieldset class="attribute_fieldset">
<label class="attribute_label" for="group_{$id_attribute_group|intval}">{$group.name|escape:'htmlall':'UTF-8'} :&nbsp;</label>
{assign var="groupName" value="group_$id_attribute_group"}
<div class="attribute_list">
{if ($group.group_type == 'select')}
<select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="attribute_select" onchange="findCombination();getProductAttribute();">
{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>
{elseif ($group.group_type == 'color')}
<ul id="color_to_pick_list" class="clearfix">
{assign var="default_colorpicker" value=""}
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<li{if $group.default == $id_attribute} class="selected"{/if}>
<a id="color_{$id_attribute|intval}" class="color_pick{if ($group.default == $id_attribute)} selected{/if}" style="background: {$colors.$id_attribute.value};" title="{$colors.$id_attribute.name}" onclick="colorPickerClick(this);getProductAttribute();">
{if file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')}
<img src="{$img_col_dir}{$id_attribute}.jpg" alt="{$colors.$id_attribute.name}" width="20" height="20" /><br />
{/if}
</a>
</li>
{if ($group.default == $id_attribute)}
{$default_colorpicker = $id_attribute}
{/if}
{/foreach}
</ul>
<input type="hidden" class="color_pick_hidden" name="{$groupName}" value="{$default_colorpicker}" />
{elseif ($group.group_type == 'radio')}
<ul>
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<li>
<input type="radio" class="attribute_radio" name="{$groupName}" value="{$id_attribute}" {if ($group.default == $id_attribute)} checked="checked"{/if} onclick="findCombination();getProductAttribute();" />
<span>{$group_attribute|escape:'htmlall':'UTF-8'}</span>
</li>
{/foreach}
</ul>
{/if}
</div>
</fieldset>
{/if}
{/foreach}
</div>
{/if}
<p id="product_reference" {if isset($groups) OR !$product->reference}style="display: none;"{/if}>
<label>{l s='Reference:'} </label>
<span class="editable">{$product->reference|escape:'htmlall':'UTF-8'}</span>
</p>
<!-- 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:'}</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='This product is not sold individually. You must select at least'} <b id="minimal_quantity_label">{$product->minimal_quantity}</b> {l s='quantity for this product.'}
</p>
{if $product->minimal_quantity > 1}
<script type="text/javascript">
checkMinimalQuantity();
</script>
{/if}
<!-- availability -->
<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_label">{l s='Availability:'}</span>
<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'}{/if}{else}{$product->available_now}{/if}</span>
</p>
<p id="availability_date"{if ($product->quantity > 0) OR !$product->available_for_order OR $PS_CATALOG_MODE OR !isset($product->available_date) OR $product->available_date < $smarty.now|date_format:'%Y-%m-%d'} style="display: none;"{/if}>
<span id="availability_date_label">{l s='Availability date:'}</span>
<span id="availability_date_value">{dateFormat date=$product->available_date full=false}</span>
</p>
<!-- number of item in stock -->
{if ($display_qties == 1 && !$PS_CATALOG_MODE && $product->available_for_order)}
<p id="pQuantityAvailable"{if $product->quantity <= 0} style="display: none;"{/if}>
<span id="quantityAvailable">{$product->quantity|intval}</span>
<span {if $product->quantity > 1} style="display: none;"{/if} id="quantityAvailableTxt">{l s='Item in stock'}</span>
<span {if $product->quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='Items in stock'}</span>
</p>
{/if}
<!-- Out of stock hook -->
<div id="oosHook"{if $product->quantity > 0} style="display: none;"{/if}>
{$HOOK_PRODUCT_OOS}
</div>
<p class="warning_inline" id="last_quantities"{if ($product->quantity > $last_qties OR $product->quantity <= 0) OR $allow_oosp OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none"{/if} >{l s='Warning: Last items in stock!'}</p>
</div>
<div class="content_prices clearfix">
<!-- prices -->
{if $product->show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}
{if $product->online_only}
<p class="online_only">{l s='Online only'}</p>
{/if}
<div class="price">
<p class="our_price_display">
{if $priceDisplay >= 0 && $priceDisplay <= 2}
<span id="our_price_display">{convertPrice price=$productPrice}</span>
<!--{if $tax_enabled && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}
{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
{/if}-->
{/if}
</p>
{if $product->on_sale}
<img src="{$img_dir}onsale_{$lang_iso}.gif" alt="{l s='On sale'}" class="on_sale_img"/>
<span class="on_sale">{l s='On sale!'}</span>
{elseif $product->specificPrice AND $product->specificPrice.reduction AND $productPriceWithoutReduction > $productPrice}
<span class="discount">{l s='Reduced price!'}</span>
{/if}
{if $priceDisplay == 2}
<br />
<span id="pretaxe_price"><span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span>&nbsp;{l s='tax excl.'}</span>
{/if}
</div>
<p id="reduction_percent" {if !$product->specificPrice OR $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}><span id="reduction_percent_display">{if $product->specificPrice AND $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if}</span></p>
<p id="reduction_amount" {if !$product->specificPrice OR $product->specificPrice.reduction_type != 'amount' || $product->specificPrice.reduction|intval ==0} style="display:none"{/if}>
<span id="reduction_amount_display">
{if $product->specificPrice AND $product->specificPrice.reduction_type == 'amount' AND $product->specificPrice.reduction|intval !=0}
-{convertPrice price=$productPriceWithoutReduction-$productPrice|floatval}
{/if}
</span>
</p>
<p id="old_price"{if !$product->specificPrice || !$product->specificPrice.reduction} class="hidden"{/if}>
{if $priceDisplay >= 0 && $priceDisplay <= 2}
<span id="old_price_display">{if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction}{/if}</span>
<!-- {if $tax_enabled && $display_tax_label == 1}{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}{/if} -->
{/if}
</p>
{if $packItems|@count && $productPrice < $product->getNoPackPrice()}
<p class="pack_price">{l s='Instead of'} <span style="text-decoration: line-through;">{convertPrice price=$product->getNoPackPrice()}</span></p>
<br class="clear" />
{/if}
{if $product->ecotax != 0}
<p class="price-ecotax">{l s='Include'} <span id="ecotax_price_display">{if $priceDisplay == 2}{$ecotax_tax_exc|convertAndFormatPrice}{else}{$ecotax_tax_inc|convertAndFormatPrice}{/if}</span> {l s='For green tax'}
{if $product->specificPrice AND $product->specificPrice.reduction}
<br />{l s='(not impacted by the discount)'}
{/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'} {$product->unity|escape:'htmlall':'UTF-8'}</p>
{/if}
{*close if for show price*}
{/if}
<p id="add_to_cart" {if (!$allow_oosp && $product->quantity <= 0) OR !$product->available_for_order OR (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE}style="display:none"{/if} class="buttons_bottom_block">
<span></span>
<input type="submit" name="Submit" value="{l s='Add to cart'}" class="exclusive" />
</p>
{if isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS}{$HOOK_PRODUCT_ACTIONS}{/if}
<div class="clear"></div>
</div>
</form>
{/if}
{if isset($HOOK_EXTRA_RIGHT) && $HOOK_EXTRA_RIGHT}{$HOOK_EXTRA_RIGHT}{/if}
</div>
</div>
{if (isset($quantity_discounts) && count($quantity_discounts) > 0)}
<!-- quantity discount -->
<ul class="idTabs clearfix">
<li><a href="#discount" style="cursor: pointer" class="selected">{l s='Sliding scale pricing'}</a></li>
</ul>
<div id="quantityDiscount">
<table class="std">
<thead>
<tr>
<th>{l s='Product'}</th>
<th>{l s='From (qty)'}</th>
<th>{if Configuration::get('PS_DISPLAY_DISCOUNT_PRICE')}{l s='Price'}{else}{l s='Discount'}{/if}</th>
</tr>
</thead>
<tbody>
{foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'}
<tr id="quantityDiscount_{$quantity_discount.id_product_attribute}" class="quantityDiscount_{$quantity_discount.id_product_attribute}">
<td>
{if (isset($quantity_discount.attributes) && ($quantity_discount.attributes))}
{$product->getProductName($quantity_discount.id_product, $quantity_discount.id_product_attribute)}
{else}
{$product->getProductName($quantity_discount.id_product)}
{/if}
</td>
<td>{$quantity_discount.quantity|intval}</td>
<td>
{if $quantity_discount.price >= 0 OR $quantity_discount.reduction_type == 'amount'}
{if Configuration::get('PS_DISPLAY_DISCOUNT_PRICE')}
{convertPrice price=$productPrice-$quantity_discount.real_value|floatval}
{else}
-{convertPrice price=$quantity_discount.real_value|floatval}
{/if}
{else}
{if Configuration::get('PS_DISPLAY_DISCOUNT_PRICE')}
{convertPrice price = $productPrice-($productPrice*$quantity_discount.reduction)|floatval}
{else}
-{$quantity_discount.real_value|floatval}%
{/if}
{/if}
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{/if}
{if isset($HOOK_PRODUCT_FOOTER) && $HOOK_PRODUCT_FOOTER}{$HOOK_PRODUCT_FOOTER}{/if}
<!-- description and features -->
{if (isset($product) && $product->description) || (isset($features) && $features) || (isset($accessories) && $accessories) || (isset($HOOK_PRODUCT_TAB) && $HOOK_PRODUCT_TAB) || (isset($attachments) && $attachments) || isset($product) && $product->customizable}
<div id="more_info_block" class="clear">
<ul id="more_info_tabs" class="idTabs idTabsShort clearfix">
{if $product->description}<li><a id="more_info_tab_more_info" href="#idTab1">{l s='More info'}</a></li>{/if}
{if $features}<li><a id="more_info_tab_data_sheet" href="#idTab2">{l s='Data sheet'}</a></li>{/if}
{if $attachments}<li><a id="more_info_tab_attachments" href="#idTab9">{l s='Download'}</a></li>{/if}
{if isset($accessories) AND $accessories}<li><a href="#idTab4">{l s='Accessories'}</a></li>{/if}
{if isset($product) && $product->customizable}<li><a href="#idTab10">{l s='Product customization'}</a></li>{/if}
{$HOOK_PRODUCT_TAB}
</ul>
<div id="more_info_sheets" class="sheets align_justify">
{if isset($product) && $product->description}
<!-- full description -->
<div id="idTab1" class="rte">{$product->description}</div>
{/if}
{if isset($features) && $features}
<!-- product's features -->
<ul id="idTab2" class="bullet">
{foreach from=$features item=feature}
{if isset($feature.value)}
<li><span>{$feature.name|escape:'htmlall':'UTF-8'}</span> {$feature.value|escape:'htmlall':'UTF-8'}</li>
{/if}
{/foreach}
</ul>
{/if}
{if isset($attachments) && $attachments}
<ul id="idTab9" class="bullet">
{foreach from=$attachments item=attachment}
<li><a href="{$link->getPageLink('attachment', true, NULL, "id_attachment={$attachment.id_attachment}")|escape:'html'}">{$attachment.name|escape:'htmlall':'UTF-8'}</a><br />{$attachment.description|escape:'htmlall':'UTF-8'}</li>
{/foreach}
</ul>
{/if}
{if isset($accessories) AND $accessories}
<!-- accessories -->
<div id="idTab4" class="bullet">
<div class="block products_block accessories_block clearfix">
<div class="block_content">
<ul>
{foreach from=$accessories item=accessory name=accessories_list}
{if ($accessory.allow_oosp || $accessory.quantity_all_versions > 0 || $accessory.quantity > 0) AND $accessory.available_for_order AND !isset($restricted_country_mode)}
{assign var='accessoryLink' value=$link->getProductLink($accessory.id_product, $accessory.link_rewrite, $accessory.category)}
<li class="ajax_block_product{if $smarty.foreach.accessories_list.first} first_item{elseif $smarty.foreach.accessories_list.last} last_item{else} item{/if} product_accessories_description">
<p class="s_title_block">
<a href="{$accessoryLink|escape:'htmlall':'UTF-8'}">{$accessory.name|escape:'htmlall':'UTF-8'}</a>
{if $accessory.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE} - <span class="price">{if $priceDisplay != 1}{displayWtPrice p=$accessory.price}{else}{displayWtPrice p=$accessory.price_tax_exc}{/if}</span>{/if}
</p>
<div class="product_desc">
<a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{$accessory.legend|escape:'htmlall':'UTF-8'}" class="product_image"><img src="{$link->getImageLink($accessory.link_rewrite, $accessory.id_image, 'medium_default')|escape:'html'}" alt="{$accessory.legend|escape:'htmlall':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" /></a>
<div class="block_description">
<a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{l s='More'}" class="product_description">{$accessory.description_short|strip_tags|truncate:400:'...'}</a>
</div>
<div class="clear_product_desc">&nbsp;</div>
</div>
<p class="clearfix" style="margin-top:5px">
<a class="button" href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{l s='View'}">{l s='View'}</a>
{if !$PS_CATALOG_MODE && ($accessory.allow_oosp || $accessory.quantity > 0)}
<a class="exclusive button ajax_add_to_cart_button" href="{$link->getPageLink('cart', true, NULL, "qty=1&amp;id_product={$accessory.id_product|intval}&amp;token={$static_token}&amp;add")|escape:'html'}" rel="ajax_id_product_{$accessory.id_product|intval}" title="{l s='Add to cart'}">{l s='Add to cart'}</a>
{/if}
</p>
</li>
{/if}
{/foreach}
</ul>
</div>
</div>
</div>
{/if}
<!-- Customizable products -->
{if isset($product) && $product->customizable}
<div id="idTab10" class="bullet customization_block">
<form method="post" action="{$customizationFormTarget}" enctype="multipart/form-data" id="customizationForm" class="clearfix">
<p class="infoCustomizable">
{l s='After saving your customized product, remember to add it to your cart.'}
{if $product->uploadable_files}<br />{l s='Allowed file formats are: GIF, JPG, PNG'}{/if}
</p>
{if $product->uploadable_files|intval}
<div class="customizableProductsFile">
<h3>{l s='Pictures'}</h3>
<ul id="uploadable_files" class="clearfix">
{counter start=0 assign='customizationField'}
{foreach from=$customizationFields item='field' name='customizationFields'}
{if $field.type == 0}
<li class="customizationUploadLine{if $field.required} required{/if}">{assign var='key' value='pictures_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field}
{if isset($pictures.$key)}
<div class="customizationUploadBrowse">
<img src="{$pic_dir}{$pictures.$key}_small" alt="" />
<a href="{$link->getProductDeletePictureLink($product, $field.id_customization_field)|escape:'html'}" title="{l s='Delete'}" >
<img src="{$img_dir}icon/delete.gif" alt="{l s='Delete'}" class="customization_delete_icon" width="11" height="13" />
</a>
</div>
{/if}
<div class="customizationUploadBrowse">
<label class="customizationUploadBrowseDescription">{if !empty($field.name)}{$field.name}{else}{l s='Please select an image file from your computer'}{/if}{if $field.required}<sup>*</sup>{/if}</label>
<input type="file" name="file{$field.id_customization_field}" id="img{$customizationField}" class="customization_block_input {if isset($pictures.$key)}filled{/if}" />
</div>
</li>
{counter}
{/if}
{/foreach}
</ul>
</div>
{/if}
{if $product->text_fields|intval}
<div class="customizableProductsText">
<h3>{l s='Text'}</h3>
<ul id="text_fields">
{counter start=0 assign='customizationField'}
{foreach from=$customizationFields item='field' name='customizationFields'}
{if $field.type == 1}
<li class="customizationUploadLine{if $field.required} required{/if}">
<label for ="textField{$customizationField}">{assign var='key' value='textFields_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field} {if !empty($field.name)}{$field.name}{/if}{if $field.required}<sup>*</sup>{/if}</label>
<textarea name="textField{$field.id_customization_field}" id="textField{$customizationField}" rows="1" cols="40" class="customization_block_input">{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}</textarea>
</li>
{counter}
{/if}
{/foreach}
</ul>
</div>
{/if}
<p id="customizedDatas">
<input type="hidden" name="quantityBackup" id="quantityBackup" value="" />
<input type="hidden" name="submitCustomizedDatas" value="1" />
<input type="button" class="button" value="{l s='Save'}" onclick="javascript:saveCustomization()" />
<span id="ajax-loader" style="display:none"><img src="{$img_ps_dir}loader.gif" alt="loader" /></span>
</p>
</form>
<p class="clear required"><sup>*</sup> {l s='required fields'}</p>
</div>
{/if}
{if isset($HOOK_PRODUCT_TAB_CONTENT) && $HOOK_PRODUCT_TAB_CONTENT}{$HOOK_PRODUCT_TAB_CONTENT}{/if}
</div>
</div>
{/if}
{if isset($packItems) && $packItems|@count > 0}
<div id="blockpack">
<h2>{l s='Pack content'}</h2>
{include file="$tpl_dir./product-list.tpl" products=$packItems}
</div>
{/if}
{/if}