335 lines
14 KiB
Smarty
Executable File
335 lines
14 KiB
Smarty
Executable File
{*
|
|
* 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}
|
|
{assign var="back_order_page" value="order-opc.php"}
|
|
{else}
|
|
{assign var="back_order_page" value="order.php"}
|
|
{/if}
|
|
|
|
{*
|
|
** Retro compatibility for PrestaShop version < 1.4.2.5 with a recent theme
|
|
** Syntax smarty for v2
|
|
*}
|
|
|
|
{* Will be deleted for 1.5 version and more *}
|
|
{if !isset($formatedAddressFieldsValuesList)}
|
|
{$ignoreList.0 = "id_address"}
|
|
{$ignoreList.1 = "id_country"}
|
|
{$ignoreList.2 = "id_state"}
|
|
{$ignoreList.3 = "id_customer"}
|
|
{$ignoreList.4 = "id_manufacturer"}
|
|
{$ignoreList.5 = "id_supplier"}
|
|
{$ignoreList.6 = "date_add"}
|
|
{$ignoreList.7 = "date_upd"}
|
|
{$ignoreList.8 = "active"}
|
|
{$ignoreList.9 = "deleted"}
|
|
|
|
{* PrestaShop 1.4.0.17 compatibility *}
|
|
{if isset($addresses)}
|
|
{foreach from=$addresses key=k item=address}
|
|
{counter start=0 skip=1 assign=address_key_number}
|
|
{$id_address = $address.id_address}
|
|
{foreach from=$address key=address_key item=address_content}
|
|
{if !in_array($address_key, $ignoreList)}
|
|
{$formatedAddressFieldsValuesList.$id_address.ordered_fields.$address_key_number = $address_key}
|
|
{$formatedAddressFieldsValuesList.$id_address.formated_fields_values.$address_key = $address_content}
|
|
{counter}
|
|
{/if}
|
|
{/foreach}
|
|
{/foreach}
|
|
{/if}
|
|
{/if}
|
|
|
|
<script type="text/javascript">
|
|
// <![CDATA[
|
|
{if !$opc}
|
|
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}";
|
|
{/if}
|
|
|
|
var imgDir = '{$img_dir}';
|
|
var authenticationUrl = '{$link->getPageLink("authentication.php", true)}';
|
|
var orderOpcUrl = '{$link->getPageLink("order.php", true)}';
|
|
var historyUrl = '{$link->getPageLink("history.php", true)}';
|
|
var guestTrackingUrl = '{$link->getPageLink("guest-tracking.php", true)}';
|
|
var addressUrl = '{$link->getPageLink("address.php", true)}';
|
|
// var orderProcess = 'order';
|
|
var guestCheckoutEnabled = {$PS_GUEST_CHECKOUT_ENABLED|intval};
|
|
var currencySign = '{$currencySign|html_entity_decode:2:"UTF-8"}';
|
|
var currencyRate = '{$currencyRate|floatval}';
|
|
var currencyFormat = '{$currencyFormat|intval}';
|
|
var currencyBlank = '{$currencyBlank|intval}';
|
|
var displayPrice = {$priceDisplay};
|
|
var taxEnabled = {$use_taxes};
|
|
var conditionEnabled = {$conditions|intval};
|
|
var countries = new Array();
|
|
var countriesNeedIDNumber = new Array();
|
|
var countriesNeedZipCode = new Array();
|
|
var vat_management = {$vat_management|intval};
|
|
|
|
var txtWithTax = "{l s='(tax incl.)'}";
|
|
var txtWithoutTax = "{l s='(tax excl.)'}";
|
|
var txtHasBeenSelected = "{l s='has been selected'}";
|
|
var txtNoCarrierIsSelected = "{l s='No carrier has been selected'}";
|
|
var txtNoCarrierIsNeeded = "{l s='No carrier is needed for this order'}";
|
|
var txtConditionsIsNotNeeded = "{l s='No terms of service must be accepted'}";
|
|
var txtTOSIsAccepted = "{l s='Terms of service are accepted'}";
|
|
var txtTOSIsNotAccepted = "{l s='Terms of service have not been accepted'}";
|
|
var txtThereis = "{l s='There is'}";
|
|
var txtErrors = "{l s='error(s)'}";
|
|
var txtDeliveryAddress = "{l s='Delivery address'}";
|
|
var txtInvoiceAddress = "{l s='Invoice address'}";
|
|
var txtModifyMyAddress = "{l s='Modify my address'}";
|
|
var txtInstantCheckout = "{l s='Instant checkout'}";
|
|
var errorCarrier = "{$errorCarrier}";
|
|
var errorTOS = "{$errorTOS}";
|
|
var checkedCarrier = "{if isset($checked)}{$checked}{else}0{/if}";
|
|
|
|
var addresses = new Array();
|
|
var isLogged = {$isLogged|intval};
|
|
var isGuest = {$isGuest|intval};
|
|
var isVirtualCart = {$isVirtualCart|intval};
|
|
var isPaymentStep = {$isPaymentStep|intval};
|
|
var addressMultishippingUrl = "{$link->getPageLink('address', true, NULL, "back={$back_order_page}?step=1{'&multi-shipping=1'|urlencode}{if $back}&mod={$back|urlencode}{/if}")}";
|
|
var addressUrl = "{$link->getPageLink('address', true, NULL, "back={$back_order_page}?step=1{if $back}&mod={$back}{/if}")}";
|
|
|
|
var formatedAddressFieldsValuesList = new Array();
|
|
|
|
{foreach from=$formatedAddressFieldsValuesList key=id_address item=type}
|
|
formatedAddressFieldsValuesList[{$id_address}] =
|
|
{ldelim}
|
|
'ordered_fields':[
|
|
{foreach from=$type.ordered_fields key=num_field item=field_name name=inv_loop}
|
|
{if !$smarty.foreach.inv_loop.first},{/if}"{$field_name}"
|
|
{/foreach}
|
|
],
|
|
'formated_fields_values':{ldelim}
|
|
{foreach from=$type.formated_fields_values key=pattern_name item=field_name name=inv_loop}
|
|
{if !$smarty.foreach.inv_loop.first},{/if}"{$pattern_name}":"{$field_name}"
|
|
{/foreach}
|
|
{rdelim}
|
|
{rdelim}
|
|
{/foreach}
|
|
|
|
function getAddressesTitles()
|
|
{
|
|
return {
|
|
'invoice': "{l s='Your billing address' js=1}",
|
|
'delivery': "{l s='Your delivery address' js=1}"
|
|
};
|
|
|
|
}
|
|
|
|
|
|
function buildAddressBlock(id_address, address_type, dest_comp)
|
|
{
|
|
var adr_titles_vals = getAddressesTitles();
|
|
var li_content = formatedAddressFieldsValuesList[id_address]['formated_fields_values'];
|
|
var ordered_fields_name = ['title'];
|
|
|
|
ordered_fields_name = ordered_fields_name.concat(formatedAddressFieldsValuesList[id_address]['ordered_fields']);
|
|
ordered_fields_name = ordered_fields_name.concat(['update']);
|
|
|
|
dest_comp.html('');
|
|
|
|
li_content['title'] = adr_titles_vals[address_type];
|
|
li_content['update'] = '<a href="{$link->getPageLink('address', true, NULL, "id_address")}'+id_address+'&back={$back_order_page}?step=1{if $back}&mod={$back}{/if}" title="{l s='Update' js=1}">» {l s='Update' js=1}</a>';
|
|
|
|
appendAddressList(dest_comp, li_content, ordered_fields_name);
|
|
}
|
|
|
|
function appendAddressList(dest_comp, values, fields_name)
|
|
{
|
|
for (var item in fields_name)
|
|
{
|
|
var name = fields_name[item];
|
|
var value = getFieldValue(name, values);
|
|
if (value != "")
|
|
{
|
|
var new_li = document.createElement('li');
|
|
new_li.className = 'address_'+ name;
|
|
new_li.innerHTML = getFieldValue(name, values);
|
|
dest_comp.append(new_li);
|
|
}
|
|
}
|
|
}
|
|
|
|
function getFieldValue(field_name, values)
|
|
{
|
|
var reg=new RegExp("[ ]+", "g");
|
|
|
|
var items = field_name.split(reg);
|
|
var vals = new Array();
|
|
|
|
for (var field_item in items)
|
|
{
|
|
items[field_item] = items[field_item].replace(",", "");
|
|
vals.push(values[items[field_item]]);
|
|
}
|
|
return vals.join(" ");
|
|
}
|
|
|
|
$(document).ready(function(){
|
|
$('#message').keyup(function(){
|
|
var chaine = $(this).val();
|
|
$(this).val(chaine.replace(/\n|\r|(\n\r)/g,' '));
|
|
});
|
|
});
|
|
|
|
//]]>
|
|
</script>
|
|
|
|
{capture name=path}{l s='Ma livraison'}{/capture}
|
|
{include file="$tpl_dir./breadcrumb.tpl"}
|
|
<div class="borderGreen auto">
|
|
<h1>[{l s='Ma livraison'}]</h1>
|
|
|
|
{if isset($smarty.get.choice_mondial_relay)}
|
|
{if $smarty.get.choice_mondial_relay == 0}
|
|
<p class="error">{l s='Please select a relay Point'}</p>
|
|
{/if}
|
|
{/if}
|
|
|
|
{assign var="current_step" value="shipping"}
|
|
{include file="$tpl_dir./order-opc-steps.tpl"}
|
|
<div class="contenu">
|
|
<form action="{$link->getPageLink($back_order_page, true)}?step=2" method="post" onsubmit="return checkPR()">
|
|
<p class="submitTop clear">
|
|
<input type="hidden" class="hidden" name="step" value="2" />
|
|
<input type="hidden" name="back" value="{$back}" />
|
|
<input type="submit" name="processAddress" value="{l s='Continuer'}" class="button uppercase" />
|
|
<a href="{$link->getPageLink($back_order_page, true, NULL, "step=0{if $back}&back={$back}{/if}")}" title="{l s='Retour'}" class="button simple">{l s='Retour'}</a>
|
|
</p>
|
|
<br class="clear" />
|
|
|
|
{include file="$tpl_dir./order-carrier-simple.tpl"}
|
|
|
|
{if !$opc}
|
|
{include file="$tpl_dir./errors.tpl"}
|
|
|
|
{else}
|
|
<div id="opc_account" class="opc-main-block">
|
|
<div id="opc_account-overlay" class="opc-overlay" style="display: none;"></div>
|
|
{/if}
|
|
<div class="addresses clearfix">
|
|
<p class="address_delivery select">
|
|
<label for="id_address_delivery">{if $cart->isVirtualCart()}{l s='Choose a billing address:'}{else}{l s='Choose a delivery address:'}{/if}</label>
|
|
<select name="id_address_delivery" id="id_address_delivery" class="address_select selectBox selectBox210" onchange="updateAddressesDisplay('clicked');{*if $opc}updateAddressSelection();{/if*}">
|
|
|
|
{foreach from=$addresses key=k item=address}
|
|
<option value="{$address.id_address|intval}" {if $address.id_address == $cart->id_address_delivery}selected="selected"{/if}>{$address.alias|escape:'htmlall':'UTF-8'}</option>
|
|
{/foreach}
|
|
|
|
</select>
|
|
|
|
<a href="{$link->getPageLink('address', true, NULL, "back={$back_order_page}?step=1&select_address=1{if $back}&mod={$back}{/if}")}" title="{l s='Add'}" class="button_grey">{l s='Add a new address'}</a>
|
|
<a href="javascript:void(0)" title="{l s='Modfier'}" class="button_grey edit_delivery">{l s='Modifier'}</a>
|
|
</p>
|
|
|
|
<ul class="address item" id="address_delivery" {if $cart->isVirtualCart()}style="display:none;"{/if}>
|
|
</ul>
|
|
<hr />
|
|
<p style="font-weight:bold;font-size:14px;">{l s='Adresse de facturation'}</p>
|
|
<div id="addressesAreEquals">
|
|
<p class="radioInvoice">
|
|
<input type="radio" name="same" id="addressesAreEquals1" value="1" onclick="updateAddressesDisplay();"{if $cart->id_address_invoice == $cart->id_address_delivery || $addresses|@count == 1} checked="checked"{/if}/>
|
|
<label for="addressesAreEquals1">{l s='Utilisez votre adresse de livraison comme adresse de facturation'}</label>
|
|
</p>
|
|
<p class="radioInvoice">
|
|
<input type="radio" name="same" id="addressesAreEquals2" value="0" onclick="updateAddressesDisplay();"{if $cart->id_address_invoice != $cart->id_address_delivery} checked="checked"{/if}/>
|
|
<label for="addressesAreEquals2">{l s='Indiquez une adresse de facturation différente'}</label>
|
|
</p>
|
|
</div>
|
|
<div class="clear" id="deliveryItems">
|
|
<p id="address_invoice_form" class="select" {if $cart->id_address_invoice == $cart->id_address_delivery}style="display: none;"{/if}>
|
|
|
|
{if $addresses|@count > 1}
|
|
<label for="id_address_invoice" class="strong" style="font-weight:bold;font-size:14px;">{l s='Choose a billing address:'}</label>
|
|
<select name="id_address_invoice" id="id_address_invoice" class="address_select selectBox selectBox210" onchange="updateAddressesDisplay();{if $opc}updateAddressSelection();{/if}">
|
|
{section loop=$addresses step=-1 name=address}
|
|
<option value="{$addresses[address].id_address|intval}" {if $addresses[address].id_address == $cart->id_address_invoice && $cart->id_address_delivery != $cart->id_address_invoice}selected="selected"{/if}>{$addresses[address].alias|escape:'htmlall':'UTF-8'}</option>
|
|
{/section}
|
|
</select>
|
|
{else}
|
|
<a href="{$link->getPageLink('address', true, NULL, "back={$back_order_page}?step=1&select_address=1{if $back}&mod={$back}{/if}")}" title="{l s='Add'}" class="button_grey">{l s='Add a new address'}</a>
|
|
{/if}
|
|
</p>
|
|
<div class="clearfix">
|
|
<ul class="address alternate_item {if $cart->isVirtualCart()}full_width{/if}" id="address_invoice">
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<hr />
|
|
{if $giftAllowed}
|
|
<div {if $total_products_wt<60}style="display:none"{/if}>
|
|
<div id="giftAllowed" >
|
|
<p style="font-size:14px;font-weight:bold;">{l s='Vous souhaitez faire un cadeau ?'}</p>
|
|
<p><small class="grey">{l s='Personnalisez la carte cadeau qui accompagnera votre colis'}</small></p>
|
|
<p class="checkbox">
|
|
<input type="checkbox" name="gift" id="gift" value="1" {if $cart->gift == 1 && $total_products_wt>=60}checked="checked"{/if} />
|
|
<label for="gift" class="uppercase">{l s='Emballage cadeau offert dès 60€ d\'achat'}</label>
|
|
{if $gift_wrapping_price > 0}
|
|
<span class="hidden" id="gift-price">
|
|
{if $priceDisplay == 1}{convertPrice price=$total_wrapping_tax_exc_cost}{else}{convertPrice price=$total_wrapping_cost}{/if}
|
|
</span>
|
|
{/if}
|
|
</p>
|
|
<p class="hidden">
|
|
<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>
|
|
<img src="{$img_dir}giftAllowed.png" alt="" style="width:310px" />
|
|
</div>
|
|
<div id="ordermsg" class="clearfix">
|
|
<p class="txt">{l s='If you would like to add a comment about your order, please write it in the field below.'}</p>
|
|
<p class="textarea"><textarea maxlength="256" cols="60" rows="3" name="message" id="message" placeholder="{l s='Votre message personnel'}">{if $cart->gift == 1 && $total_products_wt>=60}{if isset($oldMessage)}{$oldMessage}{/if}{/if}</textarea></p>
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
<div class="clear"></div>
|
|
</div>
|
|
{if !$opc}
|
|
<p class="submitTop clear">
|
|
<input type="hidden" name="back" value="{$back}" />
|
|
<input type="submit" name="processAddress" value="{l s='Continuer'}" class="button uppercase" />
|
|
<a href="{$link->getPageLink($back_order_page, true, NULL, "step=0{if $back}&back={$back}{/if}")}" title="{l s='Retour'}" class="button simple">{l s='Retour'}</a>
|
|
</p>
|
|
<div class="clear"></div>
|
|
</form>
|
|
{else}
|
|
{/if}
|
|
|
|
<p class="emptyCartWarning hidden warning">{l s='Your shopping cart is empty.'}</p>
|
|
</div>
|
|
<div class="clear"></div>
|
|
</div> |