chinatea Posted April 27, 2011 Share Posted April 27, 2011 make Phone asrequired,remove mobile phone when user registerif you need to make phone as a required field during resgist or modify account info,you can do as below:1. modify it in:\classes\Address.php, modify: protected $fieldsRequired = array(‘id_country’, ‘alias’, ‘lastname’, ‘firstname’, ‘address1’, ‘postcode’, ‘city’);to protected $fieldsRequired = array(‘id_country’, ‘alias’, ‘lastname’, ‘firstname’, ‘address1’, ‘postcode’, ‘city’,‘phone’);2. modify authentication.tpl,address.tpl,below black:{l s=‘phone number’} <input type=“text” id=“phone” name=“phone” value=”{if isset($smarty.post.phone)}{$smarty.post.phone}{else}{$address->phone|escape:‘htmlall’:‘UTF-8’}{/if}” > *3. /address.phpAdd below code in address.php if (!Validate::isPhoneNumber(Tools::getValue('phone'))) //modify by xcjing $errors[] = Tools::displayError('invalid phone number'); //end modify by xcjingthis is my example: http://getchinatea.com Link to comment Share on other sites More sharing options...
PaulJW Posted April 28, 2011 Share Posted April 28, 2011 Chinatea this looks good but I'm not sure what you changed in step 2.I'm looking to remove required fields like 'postcode' and 'other' and would like to try your steps. Link to comment Share on other sites More sharing options...
diocio Posted October 21, 2011 Share Posted October 21, 2011 wow i found answer in this thread bcause i need to make field city no required and it's worked !! thank u 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