Phone number format!

Hello, can anyone help me? When my custemors try to register and they enter phone number for example xx-xx-xx they recieve notification about number format (555) 55…



P.S. How can I change this format? Thank you. :confused:

Iwas interesting to migrate to 2.1.xx when stable version ,and the phone numbrer is problem for europe (france,spain,italy,portugal ect)

in france phone numbrer is 05 56 78 89

in spain 123 456 789





how to modifty the format in cs-cart quickly?



thanks

so really don’t understand why CS cart is not fixing this

I’m not sure why this is giving you issues. My cart doesn’t seem to care about how the number is formatted.



I just used:



xxxxxxxxxx



xxx-xxx-xxxx



(xxx) xxx-xxxx



And they all went through fine.



I took a look around the cart and I didn’t see a setting or anything.



This was in version 2.1.1.



Maybe someone esle will join in with more info.



Brandon

Phone number is one of basic information to finish the order in 1.3.5 no problem , no restriction usage ,checkout very easy for client.



phone ordering number is diferent in many country for many person



2.1.x checkout tested with 15 spanish people , 1 italian , 1 french , 1 german

only 3 allows finish the checkout phone number and they don’t understand why is not accepted standard ordering number.



french guy put : 12 23 45 67 89

the spanish put : 123 456 789

italia, austria put 1234 5678 9

germany put: 1234 567 89



Cs-cart is really good product but the phone restriction number have non sense for europe client.



Another old post to change to numeric field only

[url]http://forum.cs-cart.com/showthread.php?t=17065&highlight=phone+number[/url]

To fix this restriction go to your installation root/js/core.js around the line 65 or 69 and change it from:


phone: function(val)
{
var digits = '0123456789';
var valid_chars = '()- +';
var min_digits = 10;
var bracket = 3;
var brchr = val.indexOf('(');
var s = '';
to


phone: function(val)
{
var digits = '0123456789';
var valid_chars = '';
var min_digits = 8;
var bracket = 3;
var brchr = val.indexOf('(');
var s = '';

[quote name=‘indy0077’]To fix this restriction go to your installation root/js/core.js around the line 65 or 69 and change it from:



[/QUOTE]



Hi indy,



Housekeeping question - When minor changes like these are made to the code, Is there a way to do it via hooks. Not sure if I’ve asked this correctly…?



Like with skin changes you can keep track of changes so come upgrade time it is not impacted upon…can the same be done with .js and other similar file changes?

[quote name=‘sellon’]Hi indy,



Housekeeping question - When minor changes like these are made to the code, Is there a way to do it via hooks. Not sure if I’ve asked this correctly…?



Like with skin changes you can keep track of changes so come upgrade time it is not impacted upon…can the same be done with .js and other similar file changes?[/quote]



Not when it comes to the core functionality (js / php)

[quote name=‘JesseLeeStringer’]Not when it comes to the core functionality (js / php)[/QUOTE]



Excellent, thanks for the quick reply Jesse.



In short keep a good/updated changelog when it comes to .js & .php changes.

[quote name=‘sellon’]Excellent, thanks for the quick reply Jesse.



In short keep a good/updated changelog when it comes to .js & .php changes.[/quote]



Meh, buy ‘Beyond Compare’ from Scooter Software for $50

[url]http://www.scootersoftware.com/[/url]



Just open your store and your local hdd with a fresh install of CS and let it run the comparisons.



j.

Many Thanks Indy for the quicly fix :wink:

[quote name=‘mototropic@gmail.com’]Many Thanks Indy for the quicly fix ;)[/quote]

You’re welcome.

Why not just delete the field under Users → Profiles field and add a new input field?



CS-Cart this is not really elegant coding is it? :stuck_out_tongue:

[quote name=‘indy0077’]To fix this restriction go to your installation root/js/core.js around the line 65 or 69 and change it:


phone: function(val)
{
var digits = '0123456789';
var valid_chars = '';
var min_digits = 8;
var bracket = 3;
var brchr = val.indexOf('(');
var s = '';
[/QUOTE]



This didn’t fix it for me. Australian phone numbers are in the form (02) 1234-5678 which can be entered as:

(02) 1234-5678

02-1234-5678

0212345678

(02) 12345678

or even

(+612) 1234-5678

or all sorts of similar combinations.



Even with changes to the format mentioned in the earlier post, the error message still says that the correct format is (555) 555-5555.



a) How can I make this function more flexible?



b) Why is this buried in code and not a function in Admin?



Thanks, Steve.

Based upon user suggestions, I “believe” that all phone number format verification was removed from CS-Cart in later versions (starting with perhaps 2.1.1+) which relates to what Brandon mentioned above.



I have always believed that phone number format verification created far more problems than any benefit gained…



So, considering people are not stating which version of CS-Cart they are using, we can only assume you are using older versions!



Read about this here: [url]http://forum.cs-cart.com/vbugs.php?do=view&vbug_id=1693[/url]

Hi, I am running 2.1.1 (I upgraded recently from 2.0.15)



and I can confirm that there still is the number format checking in 2.1.1.



I may have done something wrong but I have made the change as suggested (to the core.js) and I am still having problems.



I changed var min_digits = 6;



I can still only enter a 10 digit phone number.

I was trialling 2.1.1 and it would not allow Australian phone number format. I tried the changes mentioned above and that didn’t help.



I tried an upgrade to 2.1.2 and my site has died completely. :confused:



Steve.

Hi All

I have added the above code to my core.js, and although it runs with 9 digi numbers now for europe, it kick up the 10 digit xx-xx-xxxx-xx thing if there are any gaps, all all Euro people do add in.



Can a CS Guru, or CS themselves PLEASE supply the js, code to get over this major oversight.



Like, if I don’t allow customers to add a phone number, I ain’t gonna to sell nothing dudes! Kinda silly don’t you think?

[quote name=‘Struck’]Based upon user suggestions, I “believe” that all phone number format verification was removed from CS-Cart in later versions (starting with perhaps 2.1.1+) which relates to what Brandon mentioned above.



I have always believed that phone number format verification created far more problems than any benefit gained…



So, considering people are not stating which version of CS-Cart they are using, we can only assume you are using older versions!



Read about this here: [url]http://forum.cs-cart.com/vbugs.php?do=view&vbug_id=1693[/url][/QUOTE]



WRONG! CS-Cart staff did not remove the formatting for phone number fields as they claimed to do in next version, it is still in 2.1.2 :mad:



CS, please remove the phone number field validation as spoke of in the bugtracker, this does far more harm than good. Thank You :wink:

Hi All



I spent a bit of time testing the above code, and realised all you need to do is ALLOW characters:

(

)

and space.



Then it’s happy. + is already allowed for international codes.



So my code is:



phone: function(val)

{

var digits = ‘0123456789’;

var valid_chars = ‘(’‘)’’ ‘;

var min_digits = 8;

var bracket = 3;

var brchr = val.indexOf(’(');

var s = ‘’;