Checkout Phone Number Being Entered as "United States"

General ShopSite user discussion

Checkout Phone Number Being Entered as "United States"

Postby Rgkopchak » Sun Dec 06, 2020 3:40 pm

I'm having a problem come up more and more frequently... where the customers phone number is getting entered as "UNITED STATES". I'm pretty sure this is from an "Auto-fill" situation on phones not reading the field correctly, but I'm really wondering why there doesn't seem to be field validation that the enter is in fact a valid phone number in - format?
Rgkopchak
 
Posts: 61
Joined: Wed Jul 28, 2010 7:45 am
Location: Missouri

Re: Checkout Phone Number Being Entered as "United States"

Postby cyoung » Tue Dec 08, 2020 11:39 am

You could use Javascript to validate and format a phone number. It can get a little complicated once you start factoring in all the possible formats (10-digit US phone numbers, possibly different lengths in other countries, 1 to 3 digit country codes, and also extensions). The simplest route, require the phone number contains at least 10 digits and don't attempt any formatting.

Note: that merchants with ShopSite Pro can use Commerce > Order System > Checkout > 'Javascript added at start of built-in CheckIt function' to do this, but they would have to come up with/add the custom JavaScript themselves. There are probably similar topics on the forum with other users sharing some of their custom solutions, for example:
https://forums.shopsite.com/viewtopic.php?f=1&t=8713&p=22638&hilit=format+phone+number#p22638
cyoung
 
Posts: 141
Joined: Wed Nov 09, 2016 11:01 am

Re: Checkout Phone Number Being Entered as "United States"

Postby Rgkopchak » Tue Dec 08, 2020 1:08 pm

I guess I'm just really surprised there isn't ANY validation from SS on this.

If anyone is making list of feature requests, this would be a big one... seems like an oversight to me! I wouldn't ever take data on a form without validating it first!
Rgkopchak
 
Posts: 61
Joined: Wed Jul 28, 2010 7:45 am
Location: Missouri

Re: Checkout Phone Number Being Entered as "United States"

Postby ShopSite David » Wed Dec 09, 2020 12:56 pm

Validating a phone number is a little tricky since the separators could be parenthesis, dashes, periods, spaces. It could include an extension with the abbreviation of EXT or X or something in a foreign language. But in your specific case, we could at least check for some number of numbers and if they are not there to display an error.
-David H.
ShopSite, Inc.
http://www.shopsite.com
ShopSite David
Site Admin
 
Posts: 317
Joined: Fri Aug 04, 2006 1:30 pm
Location: Utah


Return to User Forum

Who is online

Users browsing this forum: Bing [Bot] and 3 guests