Advertisement
Guest User

authentication

a guest
Apr 22nd, 2015
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.42 KB | None | 0 0
  1. {*
  2. * 2007-2013 PrestaShop
  3. *
  4. * NOTICE OF LICENSE
  5. *
  6. * This source file is subject to the Academic Free License (AFL 3.0)
  7. * that is bundled with this package in the file LICENSE.txt.
  8. * It is also available through the world-wide-web at this URL:
  9. * http://opensource.org/licenses/afl-3.0.php
  10. * If you did not receive a copy of the license and are unable to
  11. * obtain it through the world-wide-web, please send an email
  12. * to license@prestashop.com so we can send you a copy immediately.
  13. *
  14. * DISCLAIMER
  15. *
  16. * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
  17. * versions in the future. If you wish to customize PrestaShop for your
  18. * needs please refer to http://www.prestashop.com for more information.
  19. *
  20. * @author PrestaShop SA <contact@prestashop.com>
  21. * @copyright 2007-2013 PrestaShop SA
  22. * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
  23. * International Registered Trademark & Property of PrestaShop SA
  24. *}
  25.  
  26. {capture name=path}
  27. {if !isset($email_create)}{l s='Authentication'}{else}
  28. <a href="{$link->getPageLink('authentication', true)|escape:'html'}" rel="nofollow" title="{l s='Authentication'}">{l s='Authentication'}</a>
  29. <span class="navigation-pipe">{$navigationPipe}</span>{l s='Create your account'}
  30. {/if}
  31. {/capture}
  32.  
  33. <script type="text/javascript">
  34. // <![CDATA[
  35. var idSelectedCountry = {if isset($smarty.post.id_state)}{$smarty.post.id_state|intval}{else}false{/if};
  36. var countries = new Array();
  37. var countriesNeedIDNumber = new Array();
  38. var countriesNeedZipCode = new Array();
  39. {if isset($countries)}
  40. {foreach from=$countries item='country'}
  41. {if isset($country.states) && $country.contains_states}
  42. countries[{$country.id_country|intval}] = new Array();
  43. {foreach from=$country.states item='state' name='states'}
  44. countries[{$country.id_country|intval}].push({ldelim}'id' : '{$state.id_state|intval}', 'name' : '{$state.name|addslashes}'{rdelim});
  45. {/foreach}
  46. {/if}
  47. {if $country.need_identification_number}
  48. countriesNeedIDNumber.push({$country.id_country|intval});
  49. {/if}
  50. {if isset($country.need_zip_code)}
  51. countriesNeedZipCode[{$country.id_country|intval}] = {$country.need_zip_code};
  52. {/if}
  53. {/foreach}
  54. {/if}
  55. //]]>
  56. {literal}
  57. $(document).ready(function() {
  58. $('#company').on('input',function(){
  59. vat_number();
  60. });
  61. $('#company_invoice').on('input',function(){
  62. vat_number_invoice();
  63. });
  64. function vat_number()
  65. {
  66. if (($('#company').length) && ($('#company').val() != ''))
  67. $('#vat_number').show();
  68. else
  69. $('#vat_number').hide();
  70. }
  71. function vat_number_invoice()
  72. {
  73. if (($('#company_invoice').length) && ($('#company_invoice').val() != ''))
  74. $('#vat_number_block_invoice').show();
  75. else
  76. $('#vat_number_block_invoice').hide();
  77. }
  78. vat_number();
  79. vat_number_invoice();
  80. {/literal}
  81. $('.id_state option[value={if isset($smarty.post.id_state)}{$smarty.post.id_state|intval}{/if}]').prop('selected', true);
  82. {literal}
  83. });
  84. {/literal}
  85. </script>
  86.  
  87. <h1>{if !isset($email_create)}{l s='Authentication'}{else}{l s='Create an account'}{/if}</h1>
  88. {if !isset($back) || $back != 'my-account'}{assign var='current_step' value='login'}{include file="$tpl_dir./order-steps.tpl"}{/if}
  89. {include file="$tpl_dir./errors.tpl"}
  90. {assign var='stateExist' value=false}
  91. {assign var="postCodeExist" value=false}
  92. {assign var="dniExist" value=false}
  93. {if !isset($email_create)}
  94. <script type="text/javascript">
  95. {literal}
  96. $(document).ready(function(){
  97. // Retrocompatibility with 1.4
  98. if (typeof baseUri === "undefined" && typeof baseDir !== "undefined")
  99. baseUri = baseDir;
  100. $('#create-account_form').submit(function(){
  101. submitFunction();
  102. return false;
  103. });
  104. $('#invoice_address').click(function() {
  105. bindCheckbox();
  106. });
  107. bindCheckbox();
  108. });
  109. function submitFunction()
  110. {
  111. $('#create_account_error').html('').hide();
  112. //send the ajax request to the server
  113. $.ajax({
  114. type: 'POST',
  115. url: baseUri,
  116. async: true,
  117. cache: false,
  118. dataType : "json",
  119. data: {
  120. controller: 'authentication',
  121. SubmitCreate: 1,
  122. ajax: true,
  123. email_create: $('#email_create').val(),
  124. back: $('input[name=back]').val(),
  125. token: token
  126. },
  127. success: function(jsonData)
  128. {
  129. if (jsonData.hasError)
  130. {
  131. var errors = '';
  132. for(error in jsonData.errors)
  133. //IE6 bug fix
  134. if(error != 'indexOf')
  135. errors += '<li>'+jsonData.errors[error]+'</li>';
  136. $('#create_account_error').html('<ol>'+errors+'</ol>').show();
  137. }
  138. else
  139. {
  140. // adding a div to display a transition
  141. $('.container').html('<div id="noSlide">'+$('container').html()+'</div>');
  142. $('#noSlide').fadeOut('slow', function(){
  143. $('#noSlide').html(jsonData.page);
  144. // update the state (when this file is called from AJAX you still need to update the state)
  145. bindStateInputAndUpdate();
  146. $(this).fadeIn('slow', function(){
  147. document.location = '#account-creation';
  148. });
  149. });
  150. }
  151. },
  152. error: function(XMLHttpRequest, textStatus, errorThrown)
  153. {
  154. alert("TECHNICAL ERROR: unable to load form.\n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
  155. }
  156. });
  157. }
  158. function bindCheckbox()
  159. {
  160. if ($('#invoice_address:checked').length > 0)
  161. {
  162. $('#opc_invoice_address').slideDown('slow');
  163. if ($('#company_invoice').val() == '')
  164. $('#vat_number_block_invoice').hide();
  165. updateState('invoice');
  166. updateNeedIDNumber('invoice');
  167. updateZipCode('invoice');
  168. {/literal}
  169. $('.id_state option[value={if isset($smarty.post.id_state)}{$smarty.post.id_state|intval}{/if}]').prop('selected', true);
  170. $('.id_state_invoice option[value={if isset($smarty.post.id_state_invoice)}{$smarty.post.id_state_invoice|intval}{/if}]').prop('selected', true);
  171. {literal}
  172. }
  173. else
  174. $('#opc_invoice_address').slideUp('slow');
  175. }
  176. {/literal}
  177. </script>
  178. <!--{if isset($authentification_error)}
  179. <div class="error">
  180. {if {$authentification_error|@count} == 1}
  181. <p>{l s='There\'s at least one error'} :</p>
  182. {else}
  183. <p>{l s='There are %s errors' sprintf=[$account_error|@count]} :</p>
  184. {/if}
  185. <ol>
  186. {foreach from=$authentification_error item=v}
  187. <li>{$v}</li>
  188. {/foreach}
  189. </ol>
  190. </div>
  191. {/if}-->
  192. <div class="error" id="create_account_error" style="display:none"></div>
  193. <form action="{$link->getPageLink('authentication', true)}" method="post" id="create-account_form" class="std cslogin">
  194. <div class="fieldset">
  195. <h3 class="title1">{l s='Create an account'}</h3>
  196. <div class="form_content clearfix">
  197. <p class="title_block">{l s='Please enter your email address to create an account.'}.</p>
  198. <div class="error" id="create_account_error" style="display:none"></div>
  199. <p class="text">
  200. <label for="email_create">{l s='Email address'}</label>
  201. <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>
  202. </p>
  203. <p class="submit">
  204. {if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back|escape:'htmlall':'UTF-8'}" />{/if}
  205. <input type="submit" id="SubmitCreate" name="SubmitCreate" class="csbutton cssecond" value="{l s='Create an account'}" />
  206. <input type="hidden" class="hidden" name="SubmitCreate" value="{l s='Create an account'}" />
  207. </p>
  208. </div>
  209. </div>
  210. </form>
  211.  
  212. <form action="{$link->getPageLink('authentication', true)|escape:'html'}" method="post" id="login_form" class="std cslogin">
  213. <div class="fieldset">
  214. <h3 class="title1">{l s='Already registered?'}</h3>
  215. <div class="form_content clearfix">
  216. <p class="text">
  217. <label for="email">{l s='Email address'}</label>
  218. <span><input type="text" id="email" name="email" value="{if isset($smarty.post.email)}{$smarty.post.email|stripslashes}{/if}" class="account_input" /></span>
  219. </p>
  220. <p class="text">
  221. <label for="passwd">{l s='Password'}</label>
  222. <span><input type="password" id="passwd" name="passwd" value="{if isset($smarty.post.passwd)}{$smarty.post.passwd|stripslashes}{/if}" class="account_input" /></span>
  223. </p>
  224. <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>
  225. <p class="submit">
  226. {if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back|escape:'htmlall':'UTF-8'}" />{/if}
  227. <input type="submit" id="SubmitLogin" name="SubmitLogin" class="csbutton csdefault" value="{l s='Log in'}" />
  228. </p>
  229. </div>
  230. </div>
  231. </form>
  232.  
  233. {if isset($inOrderProcess) && $inOrderProcess && $PS_GUEST_CHECKOUT_ENABLED}
  234. <form action="{$link->getPageLink('authentication', true, NULL, "back=$back")|escape:'html'}" method="post" id="new_account_form" class="std clearfix">
  235. <fieldset>
  236. <h3>{l s='Instant checkout'}</h3>
  237. <div id="opc_account_form" style="display: block; ">
  238. <!-- Account -->
  239. <p class="required text">
  240. <label for="guest_email">{l s='Email address'} <sup>*</sup></label>
  241. <input type="text" class="text" id="guest_email" name="guest_email" value="{if isset($smarty.post.guest_email)}{$smarty.post.guest_email}{/if}" />
  242. </p>
  243. <p class="radio required">
  244. <span>{l s='Title'}</span>
  245. {foreach from=$genders key=k item=gender}
  246. <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} />
  247. <label for="id_gender{$gender->id}" class="top">{$gender->name}</label>
  248. {/foreach}
  249. </p>
  250. <p class="required text">
  251. <label for="firstname">{l s='First name'} <sup>*</sup></label>
  252. <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}" />
  253. <input type="hidden" class="text" id="customer_firstname" name="customer_firstname" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{/if}" />
  254. </p>
  255. <p class="required text">
  256. <label for="lastname">{l s='Last name'} <sup>*</sup></label>
  257. <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}" />
  258. <input type="hidden" class="text" id="customer_lastname" name="customer_lastname" value="{if isset($smarty.post.lastname)}{$smarty.post.lastname}{/if}" />
  259. </p>
  260. <p class="select">
  261. <span>{l s='Date of Birth'}</span>
  262. <select id="days" name="days">
  263. <option value="">-</option>
  264. {foreach from=$days item=day}
  265. <option value="{$day}" {if ($sl_day == $day)} selected="selected"{/if}>{$day}&nbsp;&nbsp;</option>
  266. {/foreach}
  267. </select>
  268. {*
  269. {l s='January'}
  270. {l s='February'}
  271. {l s='March'}
  272. {l s='April'}
  273. {l s='May'}
  274. {l s='June'}
  275. {l s='July'}
  276. {l s='August'}
  277. {l s='September'}
  278. {l s='October'}
  279. {l s='November'}
  280. {l s='December'}
  281. *}
  282. <select id="months" name="months">
  283. <option value="">-</option>
  284. {foreach from=$months key=k item=month}
  285. <option value="{$k}" {if ($sl_month == $k)} selected="selected"{/if}>{l s=$month}&nbsp;</option>
  286. {/foreach}
  287. </select>
  288. <select id="years" name="years">
  289. <option value="">-</option>
  290. {foreach from=$years item=year}
  291. <option value="{$year}" {if ($sl_year == $year)} selected="selected"{/if}>{$year}&nbsp;&nbsp;</option>
  292. {/foreach}
  293. </select>
  294. </p>
  295. {if isset($newsletter) && $newsletter}
  296. <p class="checkbox">
  297. <input type="checkbox" name="newsletter" id="newsletter" value="1" {if isset($smarty.post.newsletter) && $smarty.post.newsletter == '1'}checked="checked"{/if} autocomplete="off"/>
  298. <label for="newsletter">{l s='Sign up for our newsletter!'}</label>
  299. </p>
  300. <p class="checkbox">
  301. <input type="checkbox" name="optin" id="optin" value="1" {if isset($smarty.post.optin) && $smarty.post.optin == '1'}checked="checked"{/if} autocomplete="off"/>
  302. <label for="optin">{l s='Receive special offers from our partners!'}</label>
  303. </p>
  304. {/if}
  305. <h3>{l s='Delivery address'}</h3>
  306. {foreach from=$dlv_all_fields item=field_name}
  307. {if $field_name eq "company" && $b2b_enable}
  308. <p class="text">
  309. <label for="company">{l s='Company'}</label>
  310. <input type="text" class="text" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{/if}" />
  311. </p>
  312. {elseif $field_name eq "vat_number"}
  313. <div id="vat_number" style="display:none;">
  314. <p class="text">
  315. <label for="vat_number">{l s='VAT number'}</label>
  316. <input type="text" class="text" name="vat_number" value="{if isset($smarty.post.vat_number)}{$smarty.post.vat_number}{/if}" />
  317. </p>
  318. </div>
  319. {elseif $field_name eq "dni"}
  320. {assign var='dniExist' value=true}
  321. <p class="text">
  322. <label for="dni">{l s='Identification number'}</label>
  323. <input type="text" class="text" name="dni" id="dni" value="{if isset($smarty.post.dni)}{$smarty.post.dni}{/if}" />
  324. <span class="form_info">{l s='DNI / NIF / NIE'}</span>
  325. </p>
  326. {elseif $field_name eq "address1"}
  327. <p class="required text">
  328. <label for="address1">{l s='Address'} <sup>*</sup></label>
  329. <input type="text" class="text" name="address1" id="address1" value="{if isset($smarty.post.address1)}{$smarty.post.address1}{/if}" />
  330. </p>
  331. {elseif $field_name eq "postcode"}
  332. {assign var='postCodeExist' value=true}
  333. <p class="required postcode text">
  334. <label for="postcode">{l s='Zip / Postal Code'} <sup>*</sup></label>
  335. <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());" />
  336. </p>
  337. {elseif $field_name eq "city"}
  338. <p class="required text">
  339. <label for="city">{l s='City'} <sup>*</sup></label>
  340. <input type="text" class="text" name="city" id="city" value="{if isset($smarty.post.city)}{$smarty.post.city}{/if}" />
  341. </p>
  342. <!--
  343. if customer hasn't update his layout address, country has to be verified
  344. but it's deprecated
  345. -->
  346. {elseif $field_name eq "Country:name" || $field_name eq "country"}
  347. <p class="required select">
  348. <label for="id_country">{l s='Country'} <sup>*</sup></label>
  349. <select name="id_country" id="id_country">
  350. {foreach from=$countries item=v}
  351. <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>
  352. {/foreach}
  353. </select>
  354. </p>
  355. {elseif $field_name eq "State:name"}
  356. {assign var='stateExist' value=true}
  357. <p class="required id_state select">
  358. <label for="id_state">{l s='State'} <sup>*</sup></label>
  359. <select name="id_state" id="id_state">
  360. <option value="">-</option>
  361. </select>
  362. </p>
  363. {/if}
  364. {/foreach}
  365. {if $postCodeExist eq false}
  366. <p class="required postcode text hidden">
  367. <label for="postcode">{l s='Zip / Postal Code'} <sup>*</sup></label>
  368. <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());" />
  369. </p>
  370. {/if}
  371. {if $stateExist eq false}
  372. <p class="required id_state select hidden">
  373. <label for="id_state">{l s='State'} <sup>*</sup></label>
  374. <select name="id_state" id="id_state">
  375. <option value="">-</option>
  376. </select>
  377. </p>
  378. {/if}
  379. {if $dniExist eq false}
  380. <p class="required text dni">
  381. <label for="dni">{l s='Identification number'} <sup>*</sup></label>
  382. <input type="text" class="text" name="dni" id="dni" value="{if isset($smarty.post.dni)}{$smarty.post.dni}{/if}" />
  383. <span class="form_info">{l s='DNI / NIF / NIE'}</span>
  384. </p>
  385. {/if}
  386. <p class="{if isset($one_phone_at_least) && $one_phone_at_least}required {/if}text">
  387. <label for="phone_mobile">{l s='Mobile phone'}{if isset($one_phone_at_least) && $one_phone_at_least} <sup>*</sup>{/if}</label>
  388. <input type="text" class="text" name="phone_mobile" id="phone_mobile" value="{if isset($smarty.post.phone_mobile)}{$smarty.post.phone_mobile}{/if}" />
  389. </p>
  390. <input type="hidden" name="alias" id="alias" value="{l s='My address'}" />
  391. <input type="hidden" name="is_new_customer" id="is_new_customer" value="0" />
  392. <p class="checkbox">
  393. <input type="checkbox" name="invoice_address" id="invoice_address"{if isset($smarty.post.invoice_address) && $smarty.post.invoice_address} checked="checked"{/if} autocomplete="off"/>
  394. <label for="invoice_address"><b>{l s='Please use another address for invoice'}</b></label>
  395. </p>
  396. <div id="opc_invoice_address" class="hidden">
  397. {assign var=stateExist value=false}
  398. {assign var=postCodeExist value=false}
  399. {assign var=dniExist value=false}
  400. <h3>{l s='Invoice address'}</h3>
  401. {foreach from=$inv_all_fields item=field_name}
  402. {if $field_name eq "company" && $b2b_enable}
  403. <p class="text">
  404. <label for="company_invoice">{l s='Company'}</label>
  405. <input type="text" class="text" id="company_invoice" name="company_invoice" value="{if isset($smarty.post.company_invoice)}{$smarty.post.company_invoice}{/if}" />
  406. </p>
  407. {elseif $field_name eq "vat_number"}
  408. <div id="vat_number_block_invoice" class="hidden">
  409. <p class="text">
  410. <label for="vat_number_invoice">{l s='VAT number'}</label>
  411. <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}" />
  412. </p>
  413. </div>
  414. {elseif $field_name eq "dni"}
  415. {assign var=dniExist value=true}
  416. <p class="text">
  417. <label for="dni_invoice">{l s='Identification number'}</label>
  418. <input type="text" class="text" name="dni_invoice" id="dni_invoice" value="{if isset($smarty.post.dni_invoice)}{$smarty.post.dni_invoice}{/if}" />
  419. <span class="form_info">{l s='DNI / NIF / NIE'}</span>
  420. </p>
  421. {elseif $field_name eq "firstname"}
  422. <p class="required text">
  423. <label for="firstname_invoice">{l s='First name'} <sup>*</sup></label>
  424. <input type="text" class="text" id="firstname_invoice" name="firstname_invoice" value="{if isset($smarty.post.firstname_invoice)}{$smarty.post.firstname_invoice}{/if}" />
  425. </p>
  426. {elseif $field_name eq "lastname"}
  427. <p class="required text">
  428. <label for="lastname_invoice">{l s='Last name'} <sup>*</sup></label>
  429. <input type="text" class="text" id="lastname_invoice" name="lastname_invoice" value="{if isset($smarty.post.firstname_invoice)}{$smarty.post.firstname_invoice}{/if}" />
  430. </p>
  431. {elseif $field_name eq "address1"}
  432. <p class="required text">
  433. <label for="address1_invoice">{l s='Address'} <sup>*</sup></label>
  434. <input type="text" class="text" name="address1_invoice" id="address1_invoice" value="{if isset($smarty.post.address1_invoice)}{$smarty.post.address1_invoice}{/if}" />
  435. </p>
  436. {elseif $field_name eq "postcode"}
  437. {$postCodeExist = true}
  438. <p class="required postcode_invoice text">
  439. <label for="postcode_invoice">{l s='Zip / Postal Code'} <sup>*</sup></label>
  440. <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());" />
  441. </p>
  442. {elseif $field_name eq "city"}
  443. <p class="required text">
  444. <label for="city_invoice">{l s='City'} <sup>*</sup></label>
  445. <input type="text" class="text" name="city_invoice" id="city_invoice" value="{if isset($smarty.post.city_invoice)}{$smarty.post.city_invoice}{/if}" />
  446. </p>
  447. {elseif $field_name eq "country" || $field_name eq "Country:name"}
  448. <p class="required select">
  449. <label for="id_country_invoice">{l s='Country'} <sup>*</sup></label>
  450. <select name="id_country_invoice" id="id_country_invoice">
  451. <option value="">-</option>
  452. {foreach from=$countries item=v}
  453. <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>
  454. {/foreach}
  455. </select>
  456. </p>
  457. {elseif $field_name eq "state" || $field_name eq 'State:name'}
  458. {$stateExist = true}
  459. <p class="required id_state_invoice select" style="display:none;">
  460. <label for="id_state_invoice">{l s='State'} <sup>*</sup></label>
  461. <select name="id_state_invoice" id="id_state_invoice">
  462. <option value="">-</option>
  463. </select>
  464. </p>
  465. {/if}
  466. {/foreach}
  467. {if !$postCodeExist}
  468. <p class="required postcode_invoice text hidden">
  469. <label for="postcode_invoice">{l s='Zip / Postal Code'} <sup>*</sup></label>
  470. <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());" />
  471. </p>
  472. {/if}
  473. {if !$stateExist}
  474. <p class="required id_state_invoice select hidden">
  475. <label for="id_state_invoice">{l s='State'} <sup>*</sup></label>
  476. <select name="id_state_invoice" id="id_state_invoice">
  477. <option value="">-</option>
  478. </select>
  479. </p>
  480. {/if}
  481. {if !$dniExist}
  482. <p class="required text dni_invoice">
  483. <label for="dni_invoice">{l s='Identification number'} <sup>*</sup></label>
  484. <input type="text" class="text" name="dni_invoice" id="dni_invoice" value="{if isset($smarty.post.dni_invoice)}{$smarty.post.dni_invoice}{/if}" />
  485. <span class="form_info">{l s='DNI / NIF / NIE'}</span>
  486. </p>
  487. {/if}
  488. <p class="{if isset($one_phone_at_least) && $one_phone_at_least}required {/if}text">
  489. <label for="phone_mobile_invoice">{l s='Mobile phone'}{if isset($one_phone_at_least) && $one_phone_at_least} <sup>*</sup>{/if}</label>
  490. <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}" />
  491. </p>
  492. <input type="hidden" name="alias_invoice" id="alias_invoice" value="{l s='My Invoice address'}" />
  493. </div>
  494. </div>
  495. </fieldset>
  496. {$HOOK_CREATE_ACCOUNT_FORM}
  497. <p class="cart_navigation required submit">
  498. <span><sup>*</sup>{l s='Required field'}</span>
  499. <input type="hidden" name="display_guest_checkout" value="1" />
  500. <input type="submit" class="exclusive" name="submitGuestAccount" id="submitGuestAccount" value="{l s='Continue'}" />
  501. </p>
  502. </form>
  503. {/if}
  504. {else}
  505. <!--{if isset($account_error)}
  506. <div class="error">
  507. {if {$account_error|@count} == 1}
  508. <p>{l s='There\'s at least one error'} :</p>
  509. {else}
  510. <p>{l s='There are %s errors' sprintf=[$account_error|@count]} :</p>
  511. {/if}
  512. <ol>
  513. {foreach from=$account_error item=v}
  514. <li>{$v}</li>
  515. {/foreach}
  516. </ol>
  517. </div>
  518. {/if}-->
  519. <form action="{$link->getPageLink('authentication', true)|escape:'html'}" method="post" id="account-creation_form" class="std">
  520. {$HOOK_CREATE_ACCOUNT_TOP}
  521. <div class="account_creation fieldset">
  522. <h3 class="title1">{l s='Your personal information'}</h3>
  523. <p class="radio required">
  524. <span>{l s='Title'}</span>
  525. {foreach from=$genders key=k item=gender}
  526. <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} />
  527. <label for="id_gender{$gender->id}" class="top">{$gender->name}</label>
  528. {/foreach}
  529. </p>
  530. <p class="required text">
  531. <label for="customer_firstname">{l s='First name'} <sup>*</sup></label>
  532. <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}" />
  533. </p>
  534. <p class="required text">
  535. <label for="customer_lastname">{l s='Last name'} <sup>*</sup></label>
  536. <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}" />
  537. </p>
  538. <p class="required text">
  539. <label for="email">{l s='Email'} <sup>*</sup></label>
  540. <input type="text" class="text" id="email" name="email" value="{if isset($smarty.post.email)}{$smarty.post.email}{/if}" />
  541. </p>
  542. <p class="required password">
  543. <label for="passwd">{l s='Password'} <sup>*</sup></label>
  544. <input type="password" class="text" name="passwd" id="passwd" />
  545. <span class="form_info">{l s='(Five characters minimum)'}</span>
  546. </p>
  547. <p class="select">
  548. <span>{l s='Date of Birth'}</span>
  549. <select id="days" name="days">
  550. <option value="">-</option>
  551. {foreach from=$days item=day}
  552. <option value="{$day}" {if ($sl_day == $day)} selected="selected"{/if}>{$day}&nbsp;&nbsp;</option>
  553. {/foreach}
  554. </select>
  555. {*
  556. {l s='January'}
  557. {l s='February'}
  558. {l s='March'}
  559. {l s='April'}
  560. {l s='May'}
  561. {l s='June'}
  562. {l s='July'}
  563. {l s='August'}
  564. {l s='September'}
  565. {l s='October'}
  566. {l s='November'}
  567. {l s='December'}
  568. *}
  569. <select id="months" name="months">
  570. <option value="">-</option>
  571. {foreach from=$months key=k item=month}
  572. <option value="{$k}" {if ($sl_month == $k)} selected="selected"{/if}>{l s=$month}&nbsp;</option>
  573. {/foreach}
  574. </select>
  575. <select id="years" name="years">
  576. <option value="">-</option>
  577. {foreach from=$years item=year}
  578. <option value="{$year}" {if ($sl_year == $year)} selected="selected"{/if}>{$year}&nbsp;&nbsp;</option>
  579. {/foreach}
  580. </select>
  581. </p>
  582. {if $newsletter}
  583. <p class="checkbox" >
  584. <input type="checkbox" name="newsletter" id="newsletter" value="1" {if isset($smarty.post.newsletter) AND $smarty.post.newsletter == 1} checked="checked"{/if} autocomplete="off"/>
  585. <label for="newsletter">{l s='Sign up for our newsletter!'}</label>
  586. </p>
  587. <p class="checkbox" >
  588. <input type="checkbox"name="optin" id="optin" value="1" {if isset($smarty.post.optin) AND $smarty.post.optin == 1} checked="checked"{/if} autocomplete="off"/>
  589. <label for="optin">{l s='Receive special offers from our partners!'}</label>
  590. </p>
  591. {/if}
  592. </div>
  593. {if $b2b_enable}
  594. <fieldset class="account_creation">
  595. <h3>{l s='Your company information'}</h3>
  596. <p class="text">
  597. <label for="">{l s='Company'}</label>
  598. <input type="text" class="text" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{/if}" />
  599. </p>
  600. <p class="text">
  601. <label for="siret">{l s='SIRET'}</label>
  602. <input type="text" class="text" id="siret" name="siret" value="{if isset($smarty.post.siret)}{$smarty.post.siret}{/if}" />
  603. </p>
  604. <p class="text">
  605. <label for="ape">{l s='APE'}</label>
  606. <input type="text" class="text" id="ape" name="ape" value="{if isset($smarty.post.ape)}{$smarty.post.ape}{/if}" />
  607. </p>
  608. <p class="text">
  609. <label for="website">{l s='Website'}</label>
  610. <input type="text" class="text" id="website" name="website" value="{if isset($smarty.post.website)}{$smarty.post.website}{/if}" />
  611. </p>
  612. </div>
  613. {/if}
  614. {if isset($PS_REGISTRATION_PROCESS_TYPE) && $PS_REGISTRATION_PROCESS_TYPE}
  615. <div class="account_creation fieldset">
  616. <h3 class="title1">{l s='Your address'}</h3>
  617. {foreach from=$dlv_all_fields item=field_name}
  618. {if $field_name eq "company"}
  619. {if !$b2b_enable}
  620. <p class="text">
  621. <label for="company">{l s='Company'}</label>
  622. <input type="text" class="text" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{/if}" />
  623. </p>
  624. {/if}
  625. {elseif $field_name eq "vat_number"}
  626. <div id="vat_number" style="display:none;">
  627. <p class="text">
  628. <label for="vat_number">{l s='VAT number'}</label>
  629. <input type="text" class="text" name="vat_number" value="{if isset($smarty.post.vat_number)}{$smarty.post.vat_number}{/if}" />
  630. </p>
  631. </div>
  632. {elseif $field_name eq "firstname"}
  633. <p class="required text">
  634. <label for="firstname">{l s='First name'} <sup>*</sup></label>
  635. <input type="text" class="text" id="firstname" name="firstname" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{/if}" />
  636. </p>
  637. {elseif $field_name eq "lastname"}
  638. <p class="required text">
  639. <label for="lastname">{l s='Last name'} <sup>*</sup></label>
  640. <input type="text" class="text" id="lastname" name="lastname" value="{if isset($smarty.post.lastname)}{$smarty.post.lastname}{/if}" />
  641. </p>
  642. {elseif $field_name eq "address1"}
  643. <p class="required text">
  644. <label for="address1">{l s='Address'} <sup>*</sup></label>
  645. <input type="text" class="text" name="address1" id="address1" value="{if isset($smarty.post.address1)}{$smarty.post.address1}{/if}" />
  646. <span class="inline-infos">{l s='Street address, P.O. Box, Company name, etc.'}</span>
  647. </p>
  648. {elseif $field_name eq "address2"}
  649. <p class="text">
  650. <label for="address2">{l s='Address (Line 2)'}</label>
  651. <input type="text" class="text" name="address2" id="address2" value="{if isset($smarty.post.address2)}{$smarty.post.address2}{/if}" />
  652. <span class="inline-infos">{l s='Apartment, suite, unit, building, floor, etc...'}</span>
  653. </p>
  654. {elseif $field_name eq "postcode"}
  655. {assign var='postCodeExist' value=true}
  656. <p class="required postcode text">
  657. <label for="postcode">{l s='Zip / Postal Code'} <sup>*</sup></label>
  658. <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());" />
  659. </p>
  660. {elseif $field_name eq "city"}
  661. <p class="required text">
  662. <label for="city">{l s='City'} <sup>*</sup></label>
  663. <input type="text" class="text" name="city" id="city" value="{if isset($smarty.post.city)}{$smarty.post.city}{/if}" />
  664. </p>
  665. <!--
  666. if customer hasn't update his layout address, country has to be verified
  667. but it's deprecated
  668. -->
  669. {elseif $field_name eq "Country:name" || $field_name eq "country"}
  670. <p class="required select">
  671. <label for="id_country">{l s='Country'} <sup>*</sup></label>
  672. <select name="id_country" id="id_country">
  673. <option value="">-</option>
  674. {foreach from=$countries item=v}
  675. <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>
  676. {/foreach}
  677. </select>
  678. </p>
  679. {elseif $field_name eq "State:name" || $field_name eq 'state'}
  680. {assign var='stateExist' value=true}
  681. <p class="required id_state select">
  682. <label for="id_state">{l s='State'} <sup>*</sup></label>
  683. <select name="id_state" id="id_state">
  684. <option value="">-</option>
  685. </select>
  686. </p>
  687. {/if}
  688. {/foreach}
  689. {if $postCodeExist eq false}
  690. <p class="required postcode text hidden">
  691. <label for="postcode">{l s='Zip / Postal Code'} <sup>*</sup></label>
  692. <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());" />
  693. </p>
  694. {/if}
  695. {if $stateExist eq false}
  696. <p class="required id_state select hidden">
  697. <label for="id_state">{l s='State'} <sup>*</sup></label>
  698. <select name="id_state" id="id_state">
  699. <option value="">-</option>
  700. </select>
  701. </p>
  702. {/if}
  703. <p class="textarea">
  704. <label for="other">{l s='Additional information'}</label>
  705. <textarea name="other" id="other" cols="26" rows="3">{if isset($smarty.post.other)}{$smarty.post.other}{/if}</textarea>
  706. </p>
  707. {if isset($one_phone_at_least) && $one_phone_at_least}
  708. <p class="inline-infos required">{l s='You must register at least one phone number.'}</p>
  709. {/if}
  710. <p class="text">
  711. <label for="phone">{l s='Home phone'}</label>
  712. <input type="text" class="text" name="phone" id="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}" />
  713. </p>
  714. <p class="{if isset($one_phone_at_least) && $one_phone_at_least}required {/if} text">
  715. <label for="phone_mobile">{l s='Mobile phone'}{if isset($one_phone_at_least) && $one_phone_at_least} <sup>*</sup>{/if}</label>
  716. <input type="text" class="text" name="phone_mobile" id="phone_mobile" value="{if isset($smarty.post.phone_mobile)}{$smarty.post.phone_mobile}{/if}" />
  717. </p>
  718. <p class="required text" id="address_alias">
  719. <label for="alias">{l s='Assign an address alias for future reference.'} <sup>*</sup></label>
  720. <input type="text" class="text" name="alias" id="alias" value="{if isset($smarty.post.alias)}{$smarty.post.alias}{else}{l s='My address'}{/if}" />
  721. </p>
  722. </div>
  723. <div class="account_creation dni fieldset">
  724. <h3>{l s='Tax identification'}</h3>
  725. <p class="required text">
  726. <label for="dni">{l s='Identification number'} <sup>*</sup></label>
  727. <input type="text" class="text" name="dni" id="dni" value="{if isset($smarty.post.dni)}{$smarty.post.dni}{/if}" />
  728. <span class="form_info">{l s='DNI / NIF / NIE'}</span>
  729. </p>
  730. </div>
  731. {/if}
  732. {$HOOK_CREATE_ACCOUNT_FORM}
  733. <p class="cart_navigation required submit">
  734. <input type="hidden" name="email_create" value="1" />
  735. <input type="hidden" name="is_new_customer" value="1" />
  736. {if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back|escape:'htmlall':'UTF-8'}" />{/if}
  737. <input type="submit" name="submitAccount" id="submitAccount" value="{l s='Register'}" class="csbutton csdefault" />
  738. <span class="required"><sup>*</sup>{l s='Required field'}</span>
  739. </p>
  740. </form>
  741. {/if}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement