[+] Project: it's possible to create new genders, "Miss" gender is now added
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8578 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -51,10 +51,10 @@ countries = new Array();
|
||||
<h3>{l s='Your personal information' mod='paypal'}</h3>
|
||||
<p class="radio required">
|
||||
<span>{l s='Title'}</span>
|
||||
<input type="radio" name="id_gender" id="id_gender1" value="1" {if isset($smarty.post.id_gender) && $smarty.post.id_gender == 1}checked="checked"{/if} />
|
||||
<label for="id_gender1" class="top">{l s='Mr.' mod='paypal'}</label>
|
||||
<input type="radio" name="id_gender" id="id_gender2" value="2" {if isset($smarty.post.id_gender) && $smarty.post.id_gender == 2}checked="checked"{/if} />
|
||||
<label for="id_gender2" class="top">{l s='Ms.' mod='paypal'}</label>
|
||||
{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="customer_firstname">{l s='First name' mod='paypal'}</label>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -142,7 +142,7 @@ function submitConfirm()
|
||||
function submitAccount()
|
||||
{
|
||||
global $errors;
|
||||
|
||||
|
||||
$context = Context::getContext();
|
||||
$email = Tools::getValue('email');
|
||||
if (empty($email) OR !Validate::isEmail($email))
|
||||
@@ -150,7 +150,7 @@ function submitAccount()
|
||||
elseif (!Validate::isPasswd(Tools::getValue('passwd')))
|
||||
$errors[] = Tools::displayError('invalid password');
|
||||
elseif (Customer::customerExists($email))
|
||||
$errors[] = Tools::displayError('someone has already registered with this e-mail address');
|
||||
$errors[] = Tools::displayError('someone has already registered with this e-mail address');
|
||||
elseif (!@checkdate(Tools::getValue('months'), Tools::getValue('days'), Tools::getValue('years')) AND !(Tools::getValue('months') == '' AND Tools::getValue('days') == '' AND Tools::getValue('years') == ''))
|
||||
$errors[] = Tools::displayError('invalid birthday');
|
||||
else
|
||||
@@ -179,7 +179,7 @@ function submitAccount()
|
||||
$errors[] = Tools::displayError('an error occurred while creating your address');
|
||||
else
|
||||
{
|
||||
if (Mail::Send($context->language->id, 'account', Mail::l('Welcome!'),
|
||||
if (Mail::Send($context->language->id, 'account', Mail::l('Welcome!'),
|
||||
array('{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{email}' => $customer->email, '{passwd}' => Tools::getValue('passwd')), $customer->email, $customer->firstname.' '.$customer->lastname))
|
||||
$context->smarty->assign('confirmation', 1);
|
||||
$context->cookie->id_customer = (int)($customer->id);
|
||||
@@ -326,7 +326,8 @@ function displayAccount()
|
||||
'zip' => (Tools::getValue('postcode') ? Tools::htmlentitiesUTF8(strval(Tools::getValue('postcode'))) : (isset($result['SHIPTOZIP']) ? $result['SHIPTOZIP'] : '')),
|
||||
'payerID' => $payerID,
|
||||
'ppToken' => strval(Context::getContext()->cookie->paypal_token),
|
||||
'errors'=> $errors
|
||||
'errors'=> $errors,
|
||||
'genders' => Gender::getGenders(),
|
||||
));
|
||||
|
||||
// Display all and exit
|
||||
|
||||
Reference in New Issue
Block a user