Jump to content

Numeric value for country


Recommended Posts

In the secure checkout form, the country name appears are a numeric value. For example 840 for USA. Any ideas where to fix this?

1733300498_ScreenShot2020-08-14at4_13_35PM.thumb.png.76edcbdd6dbaa604a5d98b86f1c1d882.png

Edited by jka
Link to post
Share on other sites

The 840 is the code for USA, so we know that this is not a randomly generated thing.

Also, Massachusetts would be 32 if that database lookup was misbehaving in the same way.

Have there been any edits to the User class (/classes/user.class.php)? Specifically, the public function formatAddress()?

Any changes to /includes/functions.inc.php which is where getStateFormat() and getCountryFormat() is located?

More to the point, I see that the State input field is a simple text entry form element. There is some javascript that is supposed to change the State text entry element into drop-down selectors. More javascript will test for the presence of county_list, and if not found, will convert the Country drop-down into a text entry field.

That the fields are not drop-downs suggests that javascript is not finding the javascript variable:

Template code:
<script type="text/javascript">
   var county_list = {if !empty($STATE_JSON)}{$STATE_JSON}{else}false{/if};
</script>

Browser source:
<script type="text/javascript">
   var county_list = {"999":[{"id":"","name":"-- Please Select --"}....
</script>
where 999 is the currently selected country code.

Have your browser show you the page source and look for a <script> containing county_list.

The javascript could also be looking for the country code value for USA, but if that country has been disabled in admin, Countries/Zones, then the javascript will default to allowing the customer to free-form entry a country, and display the databased value of the user's address instead of using it as an index to the ISO3 abbreviation.

Link to post
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.

×
×
  • Create New...