Вопросы и ответы

Модуль "Отчество" настраиваем файлы шаблона ч.1

Открываем файл /themes/default-bootstrap/identity.tpl и после:
PHP:
<div class="required form-group">
    <
label for="lastname" class="required">
        {
l s='Last name'}
    </
label>
    <
input class="is_required validate form-control" data-validate="isName" type="text" name="lastname" id="lastname" value="{$smarty.post.lastname}" />
</
div>
Добавляем это:
PHP:
<div class="required form-group">
    <
label for="middlename">
        {
l s='Middle name'}
    </
label>
    <
input class="validate form-control" data-validate="isName" type="text" name="middlename" id="middlename" value="{$smarty.post.middlename}" />
</
div>
Открываем файл /themes/default-bootstrap/authentication.tpl и после:
PHP:
<div class="required form-group">
    <
label for="lastname">{l s='Last name'} <sup>*</sup></label>
    <
input type="text" class="is_required validate form-control" data-validate="isName" id="lastname" name="lastname" value="{if isset($smarty.post.lastname)}{$smarty.post.lastname}{/if}" />
</
div>
Вставляем это:

PHP:
<div class="required form-group">
    <
label for="middlename">{l s='Middle name'} <sup>*</sup></label>
    <
input type="text" class="validate form-control" data-validate="isName" id="middlename" name="middlename" value="{if isset($smarty.post.middlename)}{$smarty.post.middlename}{/if}" />
</
div>
Далее ищем:

PHP:
{elseif $field_name eq "lastname"}
<
div class="required form-group">
    <
label for="lastname_invoice">{l s='Last name'} <sup>*</sup></label>
    <
input type="text" class="form-control" id="lastname_invoice" name="lastname_invoice" value="{if isset($guestInformations) && $guestInformations.lastname_invoice}{$guestInformations.lastname_invoice}{/if}" />
</
div>
И после добавляем:
PHP:
{elseif $field_name eq "middlename"}
<
div class="required form-group">
    <
label for="middlename_invoice">{l s='Middle name'}</label>
    <
input type="text" class="form-control" id="middlename_invoice" name="middlename_invoice" value="{if isset($guestInformations) && $guestInformations.middlename_invoice}{$guestInformations.middlename_invoice}{/if}" />
</
div>
Ниже ищем:
PHP:
<div class="required form-group">
    <
label for="customer_lastname">{l s='Last name'} <sup>*</sup></label>
    <
input onkeyup="$('#lastname').val(this.value);" type="text" class="is_required validate form-control" data-validate="isName" id="customer_lastname" name="customer_lastname" value="{if isset($smarty.post.customer_lastname)}{$smarty.post.customer_lastname}{/if}" />
</
div>
И после добавляем:
PHP:
<div class="required form-group">
    <
label for="customer_middlename">{l s='Middle name'}</label>
    <
input onkeyup="$('#middlename').val(this.value);" type="text" class="validate form-control" data-validate="isName" id="customer_middlename" name="customer_middlename" value="{if isset($smarty.post.customer_middlename)}{$smarty.post.customer_middlename}{/if}" />
</
div>
Ниже находим:
PHP:
{elseif $field_name eq "lastname"}
    <
class="required 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($smarty.post.lastname)}{$smarty.post.lastname}{/if}" />
    </
p>
И после добавляем:
PHP:
{elseif $field_name eq "middlename"}
    <
class="required form-group">
        <
label for="middlename">{l s='Middle name'}</label>
        <
input type="text" class="form-control" id="middlename" name="middlename" value="{if isset($smarty.post.middlename)}{$smarty.post.middlename}{/if}" />
    </
p>
Открываем файл /themes/default-bootstrap/address.tpl и после:
PHP:
{if $field_name eq 'lastname'}
    <
div class="required form-group">
        <
label for="lastname">{l s='Last name'} <sup>*</sup></label>
        <
input class="is_required validate form-control" data-validate="{$address_validation.$field_name.validate}" type="text" id="lastname" name="lastname" value="{if isset($smarty.post.lastname)}{$smarty.post.lastname}{else}{if isset($address->lastname)}{$address->lastname|escape:'html':'UTF-8'}{/if}{/if}" />
    </
div>
{/if}
Вставляем:
PHP:
{if $field_name eq 'middlename'}
    <
div class="required form-group">
        <
label for="middlename">{l s='Middle name'}</label>
        <
input class="validate form-control" data-validate="{$address_validation.$field_name.validate}" type="text" id="middlename" name="middlename" value="{if isset($smarty.post.middlename)}{$smarty.post.middlename}{else}{if isset($address->middlename)}{$address->middlename|escape:'html':'UTF-8'}{/if}{/if}" />
    </
div>
{/if}


Last updated: Thu, Aug 1 2013 01:00


 Последнее обновление -> Thu, Aug 1 2013 01:00