Jump to content

Client Registration Cutomization


edwardmill

Recommended Posts

just to clarify, do you want to rename the field called "PHONE NUMBER" to something else - or change the format of the field.

 

the first would be in the language files, and the second would (if its possible) require a template edit.

 

Hello Brian !

 

I want to change the format of phone number field. Like right now my client are registering on any kind of format i want only specific format which is like this +44.7453993951 like this i want. you get me ?

Link to comment
Share on other sites

I want to change the format of phone number field. Like right now my client are registering on any kind of format i want only specific format which is like this +44.7453993951 like this i want. you get me ?

I get you!

 

I think this can be done, but I don't know how to do it on an existing field - though it would work with a custom field.... however, I read in another thread you're using the OpenSRSpro module, so I don't know if it would pass the field correctly to OpenSRS - you'll have to test that yourself as I don't use the module.

 

you would need to remove PHONE NUMBER from your template and create a custom field.

 

http://docs.whmcs.com/Custom_Fields

 

create a custom field using the following details:-

 

Field Name: Phone Number

Field Type: Text Box

Description: * explain that the phone number needs to be in the format +44.7453993951 *

Regex: /^\+\d{1,2}\.\d{1,10}$/

tick on "Required Field" and "Show On Order Form"

then you need to add your custom field to your template file... probably viewcart.tpl in your orderform directory... i've outlined how to do this in the thread below.

 

http://forum.whmcs.com/showthread.php?73387-Placing-individual-custom-client-fields-on-the-registration-form

 

i've tested this on my order form and your test phone number is valid - it must start with '+', then have upto 2 figures, '.' and then upto ten further figures.

 

just remember that a lot of your customers might not know their country codes, and may get frustrated about needing to enter their phone number in this specific format - so you'll need to explain the format to them well to ensure they enter it as required.

 

also, I don't think custom fields are translated - so if your site uses multiple languages, the custom field will always be shown as whatever you called it in the "Field Name" field.

Link to comment
Share on other sites

I get you!

 

I think this can be done, but I don't know how to do it on an existing field - though it would work with a custom field.... however, I read in another thread you're using the OpenSRSpro module, so I don't know if it would pass the field correctly to OpenSRS - you'll have to test that yourself as I don't use the module.

 

you would need to remove PHONE NUMBER from your template and create a custom field.

 

http://docs.whmcs.com/Custom_Fields

 

create a custom field using the following details:-

 

 

then you need to add your custom field to your template file... probably viewcart.tpl in your orderform directory... i've outlined how to do this in the thread below.

 

http://forum.whmcs.com/showthread.php?73387-Placing-individual-custom-client-fields-on-the-registration-form

 

i've tested this on my order form and your test phone number is valid - it must start with '+', then have upto 2 figures, '.' and then upto ten further figures.

 

just remember that a lot of your customers might not know their country codes, and may get frustrated about needing to enter their phone number in this specific format - so you'll need to explain the format to them well to ensure they enter it as required.

 

also, I don't think custom fields are translated - so if your site uses multiple languages, the custom field will always be shown as whatever you called it in the "Field Name" field.

 

Hello Brian,

 

Thank you so much for your detail instructions. Yeah i am using opensrs pro module. I will try now in demo website and test every step before putting live. If will get any problem i will post here and let you know. Thank you so much once again.

Link to comment
Share on other sites

two things if this doesn't work with opensrs pro...

 

1. the regex is wrong! i've had a look at the opensrs pro files and the correct regex is already in there...

 

Regex: /^([0-9]{1,3})\.[0-9]+x?[0-9]*$/

don't worry about the '+' at the start of the phone number, the opensrs pro script adds it.

 

2. by default, I think this custom field idea will fail with the opensrs pro module... actually, it will probably fail with other registrar modules too, but at least with opensrs pro it's open source and can be changed - with the whmcs modules there is no chance.

 

one way to get around this might be to add a hidden field to the form in viewcart.tpl - before the submit button, but after the custom field for telephone... that passes the value of this custom field into "phonenumber".

 

checking the opensrs pro files again, it seems to have a validate.js script that already checks the phone number format, so there may be no need for this custom field.

 

however, if you still need it, what you may have to do is replace all references to "phonenumber" in the opensrs pro scripts (not the language files) with the name of your custom field (not the name you gave it, but the name assigned by whmcs - it will be called customfield[x] where x is a number (probably 1 if this is your first custom field)... there would be around 13 changes to make.

 

frankly, you may be better off abandoning the idea of using a custom field if the javascript validation works - if it doesn't, then get OpenSRS to fix it... as i'm seeing more and more potential conflict issues being caused by the use of a custom field instead of the default phonenumber field.

Link to comment
Share on other sites

two things if this doesn't work with opensrs pro...

 

1. the regex is wrong! i've had a look at the opensrs pro files and the correct regex is already in there...

 

 

don't worry about the '+' at the start of the phone number, the opensrs pro script adds it.

 

2. by default, I think this custom field idea will fail with the opensrs pro module... actually, it will probably fail with other registrar modules too, but at least with opensrs pro it's open source and can be changed - with the whmcs modules there is no chance.

 

one way to get around this might be to add a hidden field to the form in viewcart.tpl - before the submit button, but after the custom field for telephone... that passes the value of this custom field into "phonenumber".

 

checking the opensrs pro files again, it seems to have a validate.js script that already checks the phone number format, so there may be no need for this custom field.

 

however, if you still need it, what you may have to do is replace all references to "phonenumber" in the opensrs pro scripts (not the language files) with the name of your custom field (not the name you gave it, but the name assigned by whmcs - it will be called customfield[x] where x is a number (probably 1 if this is your first custom field)... there would be around 13 changes to make.

 

frankly, you may be better off abandoning the idea of using a custom field if the javascript validation works - if it doesn't, then get OpenSRS to fix it... as i'm seeing more and more potential conflict issues being caused by the use of a custom field instead of the default phonenumber field.

 

I get you brian but problem is that you when client order something like suppose i ordering a domain right i did all the step and now i am on checkout page where i have to put all the billing information on this point client will put the random phone number means without format that stage i want to change. I hope you will get me.

 

About the opensrs module i will not touch this thing to be honest because i was playing around with opensrs module i got serious issue with the registration of domains then i have put the all the things back to work again ;) but i will try on demo website.

Link to comment
Share on other sites

what does the opensrs pro module do on the checkout form if the phone number is invalid - does it not show an error?

 

I did install the opensrs pro module when I first bought whmcs, and it totally messed up the installation so much that I deleted everything and re-installed whmcs - so i'll never install it again, and hence I can't test how it works!

 

the annoying thing about opensrs is I don't think they need the phone number format to be xxx.xxxxxxxxxx for all tlds - certainly i've recently registered .com and .tv domains using a normal telephone format (xxxx xxx xxxx), but I think .info domains need to be in your requested format, perhaps eu too.

Link to comment
Share on other sites

what does the opensrs pro module do on the checkout form if the phone number is invalid - does it not show an error?

 

I did install the opensrs pro module when I first bought whmcs, and it totally messed up the installation so much that I deleted everything and re-installed whmcs - so i'll never install it again, and hence I can't test how it works!

 

the annoying thing about opensrs is I don't think they need the phone number format to be xxx.xxxxxxxxxx for all tlds - certainly i've recently registered .com and .tv domains using a normal telephone format (xxxx xxx xxxx), but I think .info domains need to be in your requested format, perhaps eu too.

 

I made the test account first then i order a domain .co.uk after that i just try to accept the order then i got the error phone number in .co.uk then i change the phone format after that i have tried again and they gone domain is register. so that's why i thinking to change.

Edited by edwardmill
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