Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customization of registration form in Prestashop

I am new to Prestashop framework(v 1.6) and I need to do changes to the theme.

In prestashop registration form I am getting a page like follows.

anyhow i  need to change the attributes of that form like add new field or remove a field that is already existed

Where can I find the source html code part of this page and how can I delete fields of this page. If I remove the fields from the form will it affect any other functionalities of the page? (As example how can I remove birthday field from this form?)

like image 814
Roshan Jayawardana Avatar asked May 23 '14 04:05

Roshan Jayawardana


2 Answers

You should edit themes/default-bootsrap/authentication.tpl. The form starts at this line:

<form action="{$link->getPageLink('authentication', true)|escape:'html':'UTF-8'}" method="post" id="account-creation_form" class="std box">

You can remove the optional fields (e.g., Date of Birth) without any consequences.

To remove Date of Birth delete these lines:

<div class="form-group">
    <label>{l s='Date of Birth'}</label>
    <div class="row">
        <div class="col-xs-4">
            <select id="days" name="days" class="form-control">
                <option value="">-</option>
                {foreach from=$days item=day}
                    <option value="{$day}" {if ($sl_day == $day)} selected="selected"{/if}>{$day}&nbsp;&nbsp;</option>
                {/foreach}
            </select>
            {*
                {l s='January'}
                {l s='February'}
                {l s='March'}
                {l s='April'}
                {l s='May'}
                {l s='June'}
                {l s='July'}
                {l s='August'}
                {l s='September'}
                {l s='October'}
                {l s='November'}
                {l s='December'}
            *}
        </div>
        <div class="col-xs-4">
            <select id="months" name="months" class="form-control">
                <option value="">-</option>
                {foreach from=$months key=k item=month}
                    <option value="{$k}" {if ($sl_month == $k)} selected="selected"{/if}>{l s=$month}&nbsp;</option>
                {/foreach}
            </select>
        </div>
        <div class="col-xs-4">
            <select id="years" name="years" class="form-control">
                <option value="">-</option>
                {foreach from=$years item=year}
                    <option value="{$year}" {if ($sl_year == $year)} selected="selected"{/if}>{$year}&nbsp;&nbsp;</option>
                {/foreach}
            </select>
        </div>
    </div>
</div>

Make sure that during development Template compilation is set to Force compilation and Cache is set to No in PrestaShop back-office -> Advanced Parameters -> Performance.

like image 72
yenshirak Avatar answered Oct 11 '22 13:10

yenshirak


'Date of Birth' can be entered in 3 places:

  • \themes\your-theme\authenticate.tpl - Registering new account
  • \themes\your-theme\identity.tpl - Viewing account details
  • \themes\your-theme\order-opc-new-account.tpl - One Page Checkout
like image 29
Atara Avatar answered Oct 11 '22 14:10

Atara