Первым делом открываем classes/Customer.php
после
Код:
public $firstname;
добавляем
Код:
public $middlename;
меняем
Код:
protected $fieldsRequired = array('lastname', 'passwd', 'firstname', 'email');
protected $fieldsSize = array('lastname' => 32, 'passwd' => 32, 'firstname' => 32, 'email' => 128);
protected $fieldsValidate = array('secure_key' => 'isMd5', 'lastname' => 'isName', 'firstname' => 'isName', 'email' => 'isEmail', 'passwd' => 'isPasswd',
'id_gender' => 'isUnsignedId', 'birthday' => 'isBirthDate', 'newsletter' => 'isBool', 'optin' => 'isBool', 'active' => 'isBool');
на
Код:
protected $fieldsRequired = array('lastname', 'passwd', 'firstname', 'middlename', 'email');
protected $fieldsSize = array('lastname' => 32, 'passwd' => 32, 'firstname' => 32, 'middlename' => 32, 'email' => 128);
protected $fieldsValidate = array('secure_key' => 'isMd5', 'lastname' => 'isName', 'firstname' => 'isName', 'middlename' => 'isName', 'email' => 'isEmail', 'passwd' => 'isPasswd',
'id_gender' => 'isUnsignedId', 'birthday' => 'isBirthDate', 'newsletter' => 'isBool', 'optin' => 'isBool', 'active' => 'isBool');
после
Код:
$fields['firstname'] = pSQL($this->firstname);
добавляем
Код:
$fields['middlename'] = pSQL($this->middlename);
функцию
Код:
static public function getCustomers()
{
return Db::getInstance()->ExecuteS('
SELECT `id_customer`, `email`, `firstname`, `lastname`
FROM `'._DB_PREFIX_.'customer`
ORDER BY `id_customer` ASC');
}
на:
Код:
static public function getCustomers()
{
return Db::getInstance()->ExecuteS('
SELECT `id_customer`, `email`, `firstname`, `lastname`, `middlename`
FROM `'._DB_PREFIX_.'customer`
ORDER BY `id_customer` ASC');
}
файл закрываем.
Далее остается добавить все это дело в шаблоны
открываем themes/your_theme/identity.tpl и после
Код:
<p class="required text">
<label for="firstname">{l s='First name'}<sup>*</sup></label>
<input type="text" id="firstname" name="firstname" value="{$smarty.post.firstname}" />
</p>
добавляем
Код:
<p class="required text">
<label for="middlename">Отчество<sup>*</sup></label>
<input type="text" name="middlename" id="middlename" value="{$smarty.post.middlename}" />
</p>
открываем themes/your_theme/authentication.tpl и после
Код:
<p class="required text">
<label for="customer_firstname">{l s='First name'}</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}" />
<sup>*</sup>
</p>
Код:
<p class="required text">
<label for="middlename">Отчество</label>
<input onkeyup="$('#middlename').val(this.value);" type="text" class="text" id="middlename" name="middlename" value="{if isset($smarty.post.middlename)}{$smarty.post.middlename}{/if}" />
<sup>*</sup>
</p>
и через phpMyadmin, добавляем поле middlename