Jump to content

make Phone asrequired,remove mobile phone when user register


Recommended Posts

make Phone asrequired,remove mobile phone when user register

if 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.php
Add below code in address.php
if (!Validate::isPhoneNumber(Tools::getValue('phone'))) //modify by xcjing
$errors[] = Tools::displayError('invalid phone number'); //end modify by xcjing


this is my example: http://getchinatea.com

Link to comment
Share on other sites

  • 5 months later...

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