PDA

View Full Version : phone number issue - US numbers



Marc Austin
July 3, 2013, 01:13 PM
I can't seem to format the account field "phone", to display properly for US phone numbers.

I need the format to be .....

xxx-xxx-xxxx

When trying to add 503-325-0666

it appears ..... +(503)325-666

If I try to change it to....

503-325-1666

it appears +(503)325-166-6 (the 1 appears but a zero does not, and that last dash (-) between the 6's should not be there!)

How do I format it for a US number where there's a zero is the first number of the last 4 digits????????? I need that number to appear as.....

503-325-0666

HELP!

Thanks.

Viktor
July 4, 2013, 05:38 AM
Hello Marc Austin,

You can fix it yourself.
Please go to ftp://includes>>classes>>rlAccount.class.php

in method: registration find code at line ~411


case 'phone':
$out = '';

/* code */
if ( $fields[$poss]['Opt1'] )
{
$code = (int)substr($account[$key]['code'], 0, $fields[$poss]['Default']);
$out = 'c:'. $code .'|';
}

/* area */
$area = (int)$account[$key]['area'];
$out .= 'a:'. $area . '|';

/* number */
$number = (int)substr($account[$key]['number'], 0, $fields[$poss]['Values']);
$out .= 'n:'. $number;

/* extension */
if ( $fields[$poss]['Opt2'] )
{
$ext = (int)$account[$key]['ext'];
$out .= '|e:'. $ext;
}

$data2['fields'][$key] = $out;
break;


and replace to:



case 'phone':
$out = '';

/* code */
if ( $fields[$poss]['Opt1'] )
{
$code = substr($account[$key]['code'], 0, $fields[$poss]['Default']);
$out = 'c:'. $code .'|';
}

/* area */
$area = $account[$key]['area'];
$out .= 'a:'. $area . '|';

/* number */
$number =substr($account[$key]['number'], 0, $fields[$poss]['Values']);
$out .= 'n:'. $number;

/* extension */
if ( $fields[$poss]['Opt2'] )
{
$ext = $account[$key]['ext'];
$out .= '|e:'. $ext;
}

$data2['fields'][$key] = $out;
break;


then in method: editAccount find code at line ~ 1485



case 'phone':
$out = '';

/* code */
if ( $fields[$poss]['Opt1'] )
{
$code = (int)substr($account_data[$key]['code'], 0, $fields[$poss]['Default']);
$out = 'c:'. $code .'|';
}

/* area */
$area = (int)$account_data[$key]['area'];
$out .= 'a:'. $area . '|';

/* number */
$number = (int)substr($account_data[$key]['number'], 0, $fields[$poss]['Values']);
$out .= 'n:'. $number;

/* extension */
if ( $fields[$poss]['Opt2'] )
{
$ext = (int)$account_data[$key]['ext'];
$out .= '|e:'. $ext;
}

$update['fields'][$key] = $out;

break;



and replace to:



case 'phone':
$out = '';

/* code */
if ( $fields[$poss]['Opt1'] )
{
$code = substr($account_data[$key]['code'], 0, $fields[$poss]['Default']);
$out = 'c:'. $code .'|';
}

/* area */
$area = $account_data[$key]['area'];
$out .= 'a:'. $area . '|';

/* number */
$number = substr($account_data[$key]['number'], 0, $fields[$poss]['Values']);
$out .= 'n:'. $number;

/* extension */
if ( $fields[$poss]['Opt2'] )
{
$ext = $account_data[$key]['ext'];
$out .= '|e:'. $ext;
}

$update['fields'][$key] = $out;

break;


save and try again.

Marc Austin
July 4, 2013, 03:32 PM
Thanks Viktor - that now displays the zero - but the format is now....

+xxx(xxx)xxx-x

The format for US numbers needs to be....

(xxx) xxx-xxxx

Thanks in advance for your help!

Marc

Viktor
July 5, 2013, 03:38 AM
Hello Mark,

Please go to Admin Panel >> Account Fields
find your phone field and click edit icon then find 'Field Format' line and uncheck 'Code' checkbox save and try again.

Marc Austin
July 5, 2013, 04:04 AM
I tried that - now in account details (buyers side) It appears

(426) 077-7

there needs to be area code, then prefix, then 4 numbers..... like this... (xxx) xxx-xxxx

When I try selecting "code", and making the area 3 and the number length 4 (which to me, is what I should be doing - see attachment)

it appears.... +xxx (xxx) xxx-x

The parenthesis should be around the area code, there should be no plus sign, and there should be no dash before the last digit!

I am starting to get EXTREMELY frustrated. It should not take TWO DAYS to format a phone number - in the typical US format!!!!!!!!!!!!!

I have submitted a ticket about this as well.

Viktor
July 5, 2013, 08:26 AM
Hello Marc Austin,

Please set it like on my screen.

Marc Austin
July 6, 2013, 03:09 PM
That is fine, I guess..... for now.

It's too bad the system doesn't just have options for US phone format, AU format, UK format etc. (or just don't have any format at all) In the US we have a 3 digit code, a 3 digit prefix and a 4 digit number. The end user should have those 3 input boxes.... not just 2 - nor allowing a dash between the prefix and number....

Thanks though....

Marc

Austin Ellis
July 13, 2014, 08:51 PM
Im having this same issue.... it does not seem to be working... Has anyone figured out how to format the phone number for US phone numbers?

Vitor Pereira
November 8, 2014, 08:01 PM
Hello

Same problem here, i

Pete Young
November 8, 2014, 10:59 PM
Cant you just inactivate / rename that phone field and create a new numbers field called phone number ?

Curtis
November 9, 2014, 07:31 AM
Hi all,

Which format do you want have of phone field?
Show example please.

Yakup Gozel
December 13, 2017, 09:10 AM
Hello I have the same issue, we got 8 digit numbers here and all I want to look like xx xx xx xx without any dashes or parentheses. When I try to arrange it via admin panel it displays like (xxxx) xxx-x