在Prestashop中定制注册表单

时间:2014-05-23 04:30:46

标签: php prestashop-1.6

我是Prestashop框架的新手(v 1.6),我需要对主题进行更改。

在prestashop注册表单中,我得到一个如下页面。

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

我在哪里可以找到此页面的源html代码部分,如何删除此页面的字段。如果我从表单中删除字段会影响页面的任何其他功能吗? (例如,如何从此表单中删除生日字段?)

2 个答案:

答案 0 :(得分:7)

您应该修改themes/default-bootsrap/authentication.tpl。表格从这一行开始:

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

您可以删除可选字段(例如Date of Birth)而不会产生任何后果。

要删除Date of Birth,请删除这些行:

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

确保在开发过程中Template compilation设置为Force compilation且{1}}在PrestaShop后台设置为Cache - &gt; No - &gt; Advanced Parameters

答案 1 :(得分:3)

'出生日期'可以在3个地方输入:

  • \ themes \ your-theme \ authenticate.tpl - 注册新帐户
  • \ themes \ your-theme \ identity.tpl - 查看帐户详细信息
  • \ themes \ your-theme \ order-opc-new-account.tpl - One Page Checkout