Forums / Templates, Stylesheets, Page Layout / How can I modify the country list?

How can I modify the country list?

Locked

Views: 2,356

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
29 Mar 2007, 12:02 PM
#1
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

How can I modify the country list?

Hi,

99.9% of my sales come from the US and Canada. For customer convenience, I'd like the country drop-down list to start like this...

Canada
United States

Aaland Islands
...etc....
...etc....
...etc....

Canada and United States may be duplicated in their normal location in the list or not; it matters not to me. But getting those two to display at the top does matter.

I know I can edit the country list via admin, but that's for adding or removing countries. There are no options for rearranging things the way I want them. So...

Where can I edit the list to be the way I want it? And if it's the database, could you perhaps suggest the SQL statement to do the trick?

Thanks for any help with this,

Rob

Breakfast: the most important donut of the day.

30 Mar 2007, 7:18 PM
#2
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: How can I modify the country list?

Still no answers, and I'm about to slide off the page!!

Anyone?

Rob

Breakfast: the most important donut of the day.

30 Mar 2007, 9:29 PM
#3
tmc_sherpa avatar

tmc_sherpa

Zen Follower

Join Date:
Mar 2007
Posts:
158
Plugin Contributions:
0

Re: How can I modify the country list?

here's half of it
/includes/functions/html_output.php
make

function zen_get_country_list($name, $selected = '', $parameters = '') {
$countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));
$countries = zen_get_countries();
for ($i=0, $n=sizeof($countries); $i<$n; $i++) {
$countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);
}
return zen_draw_pull_down_menu($name, $countries_array, $selected, $parameters);
}

look like

function zen_get_country_list($name, $selected = '', $parameters = '') {
$countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));
$countries_array[] = array('id' => '223', 'text' => 'United States');
$countries_array[] = array('id' => '38', 'text' => 'Canada');
$countries = zen_get_countries();
for ($i=0, $n=sizeof($countries); $i<$n; $i++) {
$countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);
}
return zen_draw_pull_down_menu($name, $countries_array, $selected, $parameters);
}

it is still defaulting to the second US at the bottom of the list for me, still working on where to find that. /includes/modules/create_account.php? its getting to the end of the day on friday and the 'ol brain isn't working very well

Lazy and willing to work very hard to stay that way

31 Mar 2007, 12:13 AM
#4
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: How can I modify the country list?

I know the feeling!

Thank you very much for that. I'll try it out tomorrow, when my brain wakes up again. Right now I'm going to sit down and put my feet up and watch Metropolis. I like old movies. ;-)

Rob

Breakfast: the most important donut of the day.

31 Mar 2007, 11:48 AM
#5
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: How can I modify the country list?

it is still defaulting to the second US at the bottom of the list for me

Yeah, does the same for me too. Must be somewhere in admin that the default is set. I have a vague memory of that. I'll go spelunking for it.

In the meantime I changed the added lines to this...

    $countries_array[] = array('id' => '38', 'text' => 'Canada');             /* added */
    $countries_array[] = array('id' => '223', 'text' => 'United States');     /* added */
    $countries_array[] = array('id' => '', 'text' => '--------');             /* added */

That gives me the order and the separator line I want. And it works, except for that default, and I'll go find that now... ... ... ...

In admin/configuration/Customer Details I set Create Account Default Country ID to "none". Interestingly the list now defaults to my separator line, not to the first line where it says "Please Choose Your Country". Now to change (or eliminate) that text, and I'll be happy. ... ... ...

Did that in includes/languages/english.php -- changed it to "Please select...". Brief is good.

I'm happy. :smile:

Rob

Breakfast: the most important donut of the day.