Jump to content

State field in client area required but set as optional


cluster

Recommended Posts

WHMCS latest

modern theme

 

how can I make the state field in client area (clientareadetails.tpl) optional?

it is already marked as an optional field in the whmcs setup but in client area it does not work .. still required for any changes

 

also, the phone number field in clöient area do not allow international prefixes w/ + f.ex.

+001 45454545454

the client needs to enter 001 45454545454

but the above format is required by my registrar

Edited by cluster
Link to comment
Share on other sites

also, the phone number field in clöient area do not allow international prefixes w/ + f.ex.

+001 45454545454

the client needs to enter 001 45454545454

but the above format is required by my registrar

WHMCS automatically add international format for phone numbers:

https://developers.whmcs.com/api-reference/getclientsdetails/

"client[phonenumberformatted]": "+44.1234567890",

Link to comment
Share on other sites

  • 3 years later...
On 9/13/2017 at 5:58 PM, cluster said:

how can I make the state field in client area (clientareadetails.tpl) optional?

it is already marked as an optional field in the whmcs setup but in client area it does not work .. still required for any changes

It has not been working since first release, and still not working now.

Its very frustrating, and misleading to be able to set the state field optional in WHMCS > System Settings > General Settings > Other > Optional Client Profile Fields, but the clientarea details pages and order pages still enforce the field as required for most countries.

The only solution we found was to hardcode edit the inclusion of StatesDropdown.js in the /templates/twenty-one/clientareadetails.tpl file to the following (I suggest making your own Child Theme, to keep changes after WHMCS updates):

<script type="text/javascript" src="{$BASE_PATH_JS}/StatesDropdown2.js"></script>

And then copy the /assets/js/StatesDropdown.js file to StatesDropdown2.js and add our own country code "states":

states['DK'] = ["","Hovedstaden","Sjælland","Nordjylland","Midtjylland","Syddanmark","end"];

Leaving the first option empty, for clients not wishing to bloat their invoice details with this unwanted state field.

Please give some love for this feature request Allow State/Region Overrides

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