Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Editing Country drop down list


So_Not_an_HTML_genius

Recommended Posts

Hi,

 

I have a strange request...apparently here in the good ol' USA, we have become so "drive through..want it now..hurry hurry" that a couple of my customers hate the fact that the drop down list for countries has the US toward the end.

 

So, to appease those folks, is there a way to adjust the display of the drop down list to show US first rather than in the alphabetical order it currently is in?

 

I have only actually been working with OS Commerce for a month but am starting to really like it...I just wish I understood more about PHP and such so that I could figure this stuff out myself. I really will appreciate any info.

 

Thanks,

Kelly

Link to comment
Share on other sites

Hi,

 

I have a strange request...apparently here in the good ol' USA, we have become so "drive through..want it now..hurry hurry" that a couple of my customers hate the fact that the drop down list for countries has the US toward the end.

 

So, to appease those folks, is there a way to adjust the display of the drop down list to show US first rather than in the alphabetical order it currently is in?

 

I have only actually been working with OS Commerce for a month but am starting to really like it...I just wish I understood more about PHP and such so that I could figure this stuff out myself. I really will appreciate any info.

 

Thanks,

Kelly

 

There is a very simple contibution that does this. You can do a search for it and all it does is set the default to United States.

Kenneth S

--------------

Customer "Are you a real programmer?"

Me "No, but I did stay at a Holiday Inn Express last night"

Link to comment
Share on other sites

/includes/functions/html_output.php

 

Replace the last function on that page with this:

 

////

// Creates a pull-down list of countries

function tep_get_country_list($name, $selected = '', $parameters = '') {

# $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));

$countries_array = array(array('id' => '223', 'text' => 'United States'));

$countries = tep_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 tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters);

}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...