Customization of registration form in Prestashop

Roshan Jayawardana picture Roshan Jayawardana · May 23, 2014 · Viewed 16.2k times · Source

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?)

Answer

yenshirak picture yenshirak · May 23, 2014

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.