Jump to content

States for other countries


cenourinha

Recommended Posts

I see that you have some arrays with the states of specific countries hardcoded on the file "assets/js/StatesDropdown.js". Would it possible for WHMCS to read that information from a separated file (for example resources/country/dist.countries-states.json) and allow us to create a /resources/country/countries-states.json with custom States for each country?

Link to comment
Share on other sites

21 hours ago, cenourinha said:

Would it possible for WHMCS to read that information from a separated file (for example resources/country/dist.countries-states.json) and allow us to create a /resources/country/countries-states.json with custom States for each country?

I dislike "is it possible" questions as the answer is almost always yes in theory - it's just whether it's worth the effort. 🙂

I can't see an obvious way to do it without editing statesdropdown.js to add the custom code to read the external array - and if you're going to do that, you might as well just edit the arrays directly... yeah I know they'll get overwritten by an update, and there will have been 4 of them in the last 4 weeks, but after next week, I doubt there will be another release this year... so just a case of keeping your custom file backed up (or at least the arrays part of it).

don't get me wrong, I see your idea as a good one, and it's been mentioned here previously since WHMCS introduced customising the countries list, but I don't even think anyone has made a formal feature request for it - not that they would matter, as there are many requests to add the states/counties within country x to the array, which even though they would just be a copy & paste, and a quick verification check, haven't been completed.

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