Jump to content

Get unformatted phone number


steph.hope

Recommended Posts

I'm having an issue with the phone number field in my registrar module. I've turned off the "international phone number automatic formatting" so that I can save phone numbers to the database with the formatting I need (eg 64 7 2222222). However, when the phone numbers are brought into the module as params when doing a registration etc, they are formatted by WHMCS as eg +64.6472222222. The leading country code would be easy enough to take out, but the spaces in the number are important as the registry expects country code, area code and local number to be split out.

Is my only option to do a database call to get the unformatted phone number? As long as the Client details are being used for the registration that'll work as I can look them up by email, but if Contact details are used for the domain then there's no unique field available within the domain module to look up the contact's phone number. And there's no way within the module of knowing if it's a Client or a Contact that's being used...

Any suggestions?

Link to comment
Share on other sites

Anyway, for now I've just gone with looking it up in the database by getting the order id for the domain name, then the user or contact associated with the order. As long as there aren't duplicate records for the domain name, which it seems can happen if an order is created in the admin area, even with the "Block Existing Domains" setting active.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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