Jump to content

[SOLVED] how to edit customer account items?


Recommended Posts

dear all,

may i know how to edit the items in the customer account?

e.g. i want the mobile number to be essential and cannot leave blank during registration.

e.g. removing unwanted data. i do not require company entry, can it be remove?

e.g. i want to add new data, possible?

thank in advance.

Link to comment
Share on other sites

To make the mobile phone required, change line 80 of classes/Address.php (in PrestaShop v1.3.1) from:

protected    $fieldsRequired = array('id_country', 'alias', 'lastname', 'firstname', 'address1', 'postcode', 'city');



to:

protected    $fieldsRequired = array('id_country', 'alias', 'lastname', 'firstname', 'address1', 'postcode', 'city', 'phone_mobile');



To remove the company name, change lines 144-147 of authentication.tpl (in PrestaShop v1.3.1) from:



{l s='Company'}
   <input type="text" class="text" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{/if}" />



to:

{*

{l s='Company'}
   <input type="text" class="text" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{/if}" />
*}



and lines 38-42 of address.tpl from:



   <input type="hidden" name="token" value="{$token}" />
{l s='Company'}
   <input type="text" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{else}{$address->company|escape:'htmlall':'UTF-8'}{/if}" />



to:

<input type="hidden" name="token" value="{$token}" />
{*

{l s='Company'}
   <input type="text" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{else}{$address->company|escape:'htmlall':'UTF-8'}{/if}" />
*}



To add new fields is actually very difficult, since you need to add a new field in the database, then modify PrestaShop's customer or address class to get and set the new field, then modify authentication and address.tpl to add the field.

Link to comment
Share on other sites

Change lines 202-205 of authentication.tpl from:



{l s='Mobile phone'}
   <input type="text" class="text" name="phone_mobile" id="phone_mobile" value="{if isset($smarty.post.phone_mobile)}{$smarty.post.phone_mobile}{/if}" />



to:



{l s='Mobile phone'}
   <input type="text" class="text" name="phone_mobile" id="phone_mobile" value="{if isset($smarty.post.phone_mobile)}{$smarty.post.phone_mobile}{/if}" />
*



and lines 92-95 of address.tpl from:



{l s='Mobile phone'}
   <input type="text" id="phone_mobile" name="phone_mobile" value="{if isset($smarty.post.phone_mobile)}{$smarty.post.phone_mobile}{else}{$address->phone_mobile|escape:'htmlall':'UTF-8'}{/if}" />



to:



{l s='Mobile phone'}
   <input type="text" id="phone_mobile" name="phone_mobile" value="{if isset($smarty.post.phone_mobile)}{$smarty.post.phone_mobile}{else}{$address->phone_mobile|escape:'htmlall':'UTF-8'}{/if}" />
*

Link to comment
Share on other sites

  • 1 year later...

Hi, I using 1.4.8.2 version, and in One Page Checkout authentication was said then phone mobile is required, but I checked in classes/address.php and isn't.

 

And when one page checkout using guest checkout, the field of phone mobile isn't appear, how can be required ?

I need to remove this.

 

Thnks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...