Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Removing countries from database


Guest

Recommended Posts

I want to thin out the country table ...I know I can do this through the admin interface but that will take forever. If I wanted to simply delete the ones I don't want directly using SQL, are there any foreign records I should be aware of?

 

Basically, I only want the US as a country.

Link to comment
Share on other sites

Instead of deleteing countries from the countries table - you can just modify the country dropdowns instead. This is done from /catalog/includes/functions/html_output.php.

 

To display all countries - but display United States as the first one in the list find this line:

 

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

 

and change to this:

 

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

 

To only display United States only in the dropdown (i.e. your dropdown consists of one country) find this line:

 

$countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);

 

and replace with this:

 

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

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...