Difference between revisions of "Customising Countries and Calling Codes"
(→Troubleshooting) |
|||
Line 59: | Line 59: | ||
If after making an edit to your custom ''/resources/country/countries.json'' file, it does not take effect, this indicates that the file contains invalid syntax. | If after making an edit to your custom ''/resources/country/countries.json'' file, it does not take effect, this indicates that the file contains invalid syntax. | ||
− | The file must contain valid JSON Syntax. Running the contents of your file through an online syntax validation checker such as http://www.jsonlint.com/ | + | The file must contain valid JSON Syntax. Running the contents of your file through an online syntax validation checker such as http://www.jsonlint.com/ can help pinpoint any issues. |
Revision as of 10:23, 20 March 2017
Contents
What are the Countries?
The countries file defines the countries shown within WHMCS and their respective calling codes.
Customising Countries
The country definitions shipped with WHMCS by default can be found in resources/country/dist.countries.json. This file should not be edited.
To customise the list of countries, begin by creating a custom countries.json file in /resources/country/
Adding a Country
Inside your /resources/country/countries.json file, add a section as follows:
{
"ABC": {
"name": "Awesome Best Country",
"callingCode": 12345
}
}
This will add a country with the display name "Awesome Best Country".
Modifying a Country
Inside your /resources/country/countries.json file, add a section as follows:
{
"GB": {
"name": "Great Britain",
"callingCode": 44
}
}
The above would customise the display name for United Kingdom (GB) to Great Britain.
Removing a Country
Inside your /resources/country/countries.json file, add a section as follows:
{
"GB": false
}
The above would remove GB (United Kingdom) from the available countries within WHMCS.
Troubleshooting
If after making an edit to your custom /resources/country/countries.json file, it does not take effect, this indicates that the file contains invalid syntax.
The file must contain valid JSON Syntax. Running the contents of your file through an online syntax validation checker such as http://www.jsonlint.com/ can help pinpoint any issues.