Country/Province/State option customizing...

Posts: 67
Joined: 08/10/2007

Is there any way we can actually get the country/province/state options to show up with their actual abbreviations instead of these numbers that show up in the checkout process:

...
<option value="67">British Columbia</option>
<option value="68">Manitoba</option>
...

just so I can pass these on to my merchant properly without the confusing # values...

Posts: 5625
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Using the ID helps the current system of tracking countries/zones. However, there is a helper function that will return the abbreviation based on the ID:

<?php
  $abbr
= uc_get_zone_code($zone_id);
?>

Posts: 67
Joined: 08/10/2007

so wait, would a simple change like this (line 2178 in uc_store.module):

FROM:

$options[$zone->zone_id] = ($display == 'code') ? $zone->zone_code : $zone->zone_name;

TO

$options[$zone->zone_code] = ($display == 'code') ? $zone->zone_code : $zone->zone_name;

change anything significantly in terms of order tracking, in the core functionality of ubercart?

if not, I'll just go with this modification for now...

Posts: 5625
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

It wouldn't work, because the field for zones in the database expects an integer not a string. Also, all the submit functions are looking for integers I believe...