2015-08-11 17:56:07 +02:00

138 lines
6.1 KiB
Smarty

{capture name=path}
<a href="{$link->getPageLink('my-account', true)|escape:'html':'UTF-8'}" data-gg="">{l s='My account'}</a>
<span class="navigation_page">{l s='Your address'}</span>
{/capture}
<div class="intro_top">
<div class="container">
<div class="intro_cat">
<h1>{l s='Your address'}</h1>
</div>
</div>
</div>
<div id="breadcrumbs">
<div class="container">
{include file="$tpl_dir./breadcrumb.tpl"}
</div>
</div>
<main>
<section>
{include file="$tpl_dir./errors.tpl"}
<div class="container account">
<div class="row">
{include file="$tpl_dir./menu-account.tpl"}
<div class="col-md-9">
<form action="{$link->getPageLink('address', true)|escape:'html':'UTF-8'}" method="post" class="account-creation box" id="add_address">
<h2><span>{if isset($id_address)}{l s='Your address'}{else}{l s='New address'}{/if}</span></h2>
<div class="box-content clearfix">
{assign var="stateExist" value=false}
{assign var="postCodeExist" value=false}
{assign var="dniExist" value=false}
{assign var="homePhoneExist" value=false}
{assign var="mobilePhoneExist" value=false}
{assign var="atLeastOneExists" value=false}
<div class="row">
<p class="required col-md-6 form-group">
<label for="firstname">{l s='First name'} <sup>*</sup></label>
<input type="text" class="form-control" id="firstname" name="firstname" value="{if isset($address->firstname)}{$address->firstname}{/if}" />
</p>
<p class="required col-md-6 form-group">
<label for="lastname">{l s='Last name'} <sup>*</sup></label>
<input type="text" class="form-control" id="lastname" name="lastname" value="{if isset($address->lastname)}{$address->lastname}{/if}" />
</p>
</div>
<div class="row">
<p class="required col-md-6 form-group">
<label for="address1">{l s='Address'} <sup>*</sup></label>
<input type="text" class="form-control" name="address1" id="address1" value="{if isset($address->address1)}{$address->address1}{/if}" />
</p>
<p class="form-group col-md-6 is_customer_param">
<label for="address2">{l s='Address (Line 2)'}</label>
<input type="text" class="form-control" name="address2" id="address2" value="{if isset($address->address2)}{$address->address2}{/if}" />
</p>
</div>
<div class="row">
<p class="required col-md-3 postcode form-group">
<label for="postcode">{l s='Zip/Postal Code'} <sup>*</sup></label>
<input type="text" class="form-control" name="postcode" id="postcode" value="{if isset($address->postcode)}{$address->postcode}{/if}" onkeyup="$('#postcode').val($('#postcode').val().toUpperCase());" />
</p>
<p class="required col-md-6 form-group">
<label for="city">{l s='City'} <sup>*</sup></label>
<input type="text" class="form-control" name="city" id="city" value="{if isset($address->city)}{$address->city}{/if}" />
</p>
<p class="required col-md-3 select form-group">
<label for="id_country">{l s='Country'} <sup>*</sup></label>
<select name="id_country" id="id_country" class="custom-input form-control">
<option value="">-</option>
{foreach from=$countries item=v}
<option value="{$v.id_country}"{if (isset($address->id_country) AND $address->id_country == $v.id_country) OR (!isset($address->id_country) && $sl_country == $v.id_country)} selected="selected"{/if}>{$v.name}</option>
{/foreach}
</select>
</p>
</div>
<div class="row">
<p class="required col-md-6 form-group">
<label for="phone">{l s='Home phone'} <sup>*</sup></label>
<input type="text" class="form-control" name="phone" id="phone" value="{if isset($address->phone)}{$address->phone}{/if}" />
</p>
<p class="{if isset($one_phone_at_least) && $one_phone_at_least}required {/if}col-md-6 form-group">
<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="form-control" name="phone_mobile" id="phone_mobile" value="{if isset($address->phone_mobile)}{$address->phone_mobile}{/if}" />
</p>
<p class="required col-md-6 form-group" id="address_alias">
<label for="alias">{l s='Assign an address alias for future reference.'} <sup>*</sup></label>
<input type="text" class="form-control" name="alias" id="alias" value="{if isset($address->alias)}{$address->alias}{else}{l s='My address'}{/if}" />
</p>
</div>
<div class="hidden">
{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}" />
</div>
<p class="submit">
<button type="submit" name="submitAddress" id="submitAddress" class="btn black pull-right">
{l s='Save'}
</button>
</p>
</div>
</form>
</div>
</div>
</div>
</section>
{strip}
{if isset($smarty.post.id_state) && $smarty.post.id_state}
{addJsDef idSelectedState=$smarty.post.id_state|intval}
{else if isset($address->id_state) && $address->id_state}
{addJsDef idSelectedState=$address->id_state|intval}
{else}
{addJsDef idSelectedState=false}
{/if}
{if isset($smarty.post.id_country) && $smarty.post.id_country}
{addJsDef idSelectedCountry=$smarty.post.id_country|intval}
{else if isset($address->id_country) && $address->id_country}
{addJsDef idSelectedCountry=$address->id_country|intval}
{else}
{addJsDef idSelectedCountry=false}
{/if}
{if isset($countries)}
{addJsDef countries=$countries}
{/if}
{if isset($vatnumber_ajax_call) && $vatnumber_ajax_call}
{addJsDef vatnumber_ajax_call=$vatnumber_ajax_call}
{/if}
{/strip}
</main>