Jump to content

Numeric value for country


jka

Recommended Posts

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 comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...