jump to navigation

Default country dropdown lists in oscommerce November 18, 2007

Posted by admin in : Simple Issues , add a comment

A client had this query… 

How to change the country dropdown lists to default to a specific country. As you know hey default to aphabetical order. I want to be able to have United States to be listed out of order at the top of the list with the others in the normal order. Is this a php edit or a SQL edit and where and how would it be done?

Solution :

You can also make any country appear by default while still having the pull down list available.

In includes/functions/html_output.php at about line 299 find:

$countries_array = array(array(’id’ => ”, ‘text’ => PULL_DOWN_DEFAULT));

Replace (for the United States) with…

// $countries_array = array(array(’id’ => ”, ‘text’ => PULL_DOWN_DEFAULT));
$countries_array = array(array(’id’ => ‘223′, ‘text’ => ‘United States’));

You can change the country id and the text in this line to make any country appear by default.

Cheers !