obeydatdog Posted August 29, 2010 Share Posted August 29, 2010 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 More sharing options...
rocky Posted August 30, 2010 Share Posted August 30, 2010 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 More sharing options...
obeydatdog Posted August 30, 2010 Author Share Posted August 30, 2010 Thanks for e information. Will try it out later and update e result. Link to comment Share on other sites More sharing options...
obeydatdog Posted August 30, 2010 Author Share Posted August 30, 2010 hi,i have tried and to remove the company and to make the mobile phone required is successful. thanks.have another question, how to show * on the mobile phone. Link to comment Share on other sites More sharing options...
rocky Posted August 31, 2010 Share Posted August 31, 2010 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 More sharing options...
obeydatdog Posted August 31, 2010 Author Share Posted August 31, 2010 thank you so much, u solved all my question. Link to comment Share on other sites More sharing options...
anmbr Posted May 30, 2012 Share Posted May 30, 2012 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now