Jump to content

phone number country code missing (API)


cluster

Recommended Posts

my phone number issue is back, if I submit a  domain registration via registrar module it cuts of the country code numbers, in database and order emails it shows the complete phone number but it does not work for the API anymore ... f.ex.

+33 9999999 is now formated as +9999999 

2 days ago I have syncronized the URLs and added the code into the .htaccess, here is my current phone number formating, the + symbol keeps in place only the number of the country code is missing now.

'phonenumber'         => "+".str_replace('.','',$params["phonenumber"]),

 

Link to comment
Share on other sites

some more details ...

after changing / save a client phone number from the admin area the client log shows:

Client Profile Modified - Phone Number: '9999999' to '+33.9999999' (doesent matter how many time it's been saved, it shows only the local number in the log afterwards)

but it's not changed, if I submit the order to the registar or hosting panel it is saved as 9999999 w/o any country code

It seems the syncing of URL friendly (index.php only, same as before) disabled phone number formating for outgoing API requests

 

Edited by cluster
Link to comment
Share on other sites

Hi Chris,

- WHMCS 7.4.2

- Registrar: EuroDNS

- Phone Number formatting is enabled

because of a JS search functionissue  in transaction user field I have syncronised the SEO URLs (index.php only) and inserted the displayed code in the htaccess

rewrite base is disabled because a subfolder installation of whmcs.

the complete phone number is shown in order emails but the country code is missing in user logs (when changing) of whmcs and outgoing requests to the registrar API.

Client Profile Modified - Phone Number: '9999999' to '+33.9999999'  is shown also after a 2nd click "save" client profile

### BEGIN - WHMCS managed rules - DO NOT EDIT BETWEEN WHMCS MARKERS ###
<IfModule mod_rewrite.c>
RewriteEngine on

# RewriteBase is set to "/" so rules do not need updating if the
# installation directory is relocated.  It is imperative that
# there is also a RewriteCond rule later that can effectively get
# the actual value by comparison against the request URI.
# 
# If there are _any_ other RewriteBase directives in this file,
# the last entry will take precedence!
#RewriteBase /

# Redirect directories to an address with slash
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$  $1/ [R]

# Send all remaining (routable paths) through index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Determine and use the actual base
RewriteCond $0#%{REQUEST_URI} ([^#]*)#(.*)\1$
RewriteRule ^.*$ %2index.php [QSA,L]
</IfModule>
### END - WHMCS managed rules - DO NOT EDIT BETWEEN WHMCS MARKERS ###

 

Link to comment
Share on other sites

It took me a whole week to edit all my customers for the new phone number feature ...
It worked for about one month and after the URL syncing for the JS fix (client search in transactions), now the country code number is ignored ... I can not add another week to change all the phone numbers again.
So I need a solution!

Link to comment
Share on other sites

it acts as if the function int. phone number formating has been disabled, but it is enabled ...

the country code is also missing after a new hosting package was created from whmcs to a server, the client profile shows only the local phone number w/o country code.
 

Link to comment
Share on other sites

it seems i am using a contolpanel module which contains its own composer version ...
could the problem be caused by an interaction with composer, or is that a BUG in whmcs?

I have previously tested on another whmcs version and there is synonymous when changing the client profile (phonenumber) only the landline without country prefix displayed in the log

Link to comment
Share on other sites

to reproduce ...
edit a client profile (phone number) change only the landline number e.g.
+1 12345 to +1 123456
Save
check the client log tab
there you see changed from 12345 to +1 123456
then just save it again
it shows ... changed from 12345 to +1 123456

then send a domain registration to a sandbox API
in the API log you only see the landline +12345 as phonenumber instead of +1 123456

Link to comment
Share on other sites

 

yes it's checked, it worked for about 2 weeks, after the friendly URL syncing the problem has started ... the database entrys are fine it shows the complete phone number.

the problems is that $_POST did not submit the country code dropdown field when saving the profile form or create a server and register a domain name, the country code field is ignored

Phone Numbers Tick to enable international phone number input interface and automatic formatting
Link to comment
Share on other sites

30 minutes ago, cluster said:

if I turn it off (Phone Number formatting) are the country codes removed from the database user phone numbers right after?

no... but if you then enter a number again, the format entered will be preserved.

the feature should be disabled for you anyway... I can't see the point in enabling it, and then complaining that it's changing the formatting of the entered value - that's what it does!

Link to comment
Share on other sites

22 hours ago, cluster said:

would it be possible to keep it only for the frontend by editing the checkout.tpl?

I doubt you could do it purely by editing the template, possibly with a hook to enable it on the checkout stage only...

<?php

/**
* Enable Phone Number Interface @ Checkout
* @author brian!
*/
 
function cart_phone_interface_hook($vars)
{
	if ($vars['templatefile']=='viewcart'){
		return array("phoneNumberInputStyle" => "1");
	}
}
add_hook("ClientAreaPageCart", 1, "cart_phone_interface_hook");

number entered at checkout...

Byz6mQ8.png

and stored in the database...

loDAecM.png

so it's adding the country code, removing the leading 0 and not removing spaces.

personally, this is like being pregnant - either you are or you're not... either you use the phone number feature or you don't.... partially enabling it just at checkout could be asking for trouble.... :twisted:

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated