Guest Posted September 11, 2002 Share Posted September 11, 2002 Hi How can I easily remove (delete) all the countries i don't need? I only want to sell products in my own country. Link to comment Share on other sites More sharing options...
Harald Ponce de Leon Posted September 11, 2002 Share Posted September 11, 2002 How can I easily remove (delete) all the countries i don't need?I only want to sell products in my own country. Look what searching for "delete countries" brought up: http://www.oscommerce.com/forums/viewtopic.php...elete+countries , osCommerce Link to comment Share on other sites More sharing options...
Guest Posted September 11, 2002 Share Posted September 11, 2002 Thanks, alot... :D Link to comment Share on other sites More sharing options...
Big_Daddy Posted September 12, 2002 Share Posted September 12, 2002 Hey Harold, I have a few things I would like for you to search for me too... Just kidding, keep up the good work guys. Brandon Sweet Link to comment Share on other sites More sharing options...
Guest Posted April 28, 2004 Share Posted April 28, 2004 Look what a search for "delete countries" and +delete +countries brought me: ..... ..... ..... NOTHING Also, the above link is no longer valid. The search feature has been sucking lately. I spend hours trying to rig searches to work right for something that should take a few minutes to find. Link to comment Share on other sites More sharing options...
badjo Posted April 29, 2004 Share Posted April 29, 2004 If you figure it out please let me know.. I have been trying to hardcode in US orders only for some time and it is creating a dominoe effect of errors. I really want to take it a step further and only allow shipping to certain states in the US anyone want to make a few bucks to write this mod? let me know, Badjo Link to comment Share on other sites More sharing options...
bluepony Posted April 29, 2004 Share Posted April 29, 2004 I set a filter on my site. I just added another column to the Countries table called Show_Country and then marked the ones that I wanted to include. Then I just added a Where clause to the SQL statement in the tep_get_countries function: Add a new column to the Countries table called show_country. Make it an Int field, size 11, default value 0 Then mark the countries that you want to show in your drop-down list by putting a 1 in their show_country field. Edit the tep_get_countries function in includes/functions/general.php. Around line number 239, look for: $countries = tep_db_query("select countries_id, countries_name from " . TABLE_COUNTRIES . " order by countries_name"); and add a where clause to it: $countries = tep_db_query("select countries_id, countries_name from " . TABLE_COUNTRIES . " where show_country=1 order by countries_name"); You could probably do the same with the States. I'd rather be flying! Link to comment Share on other sites More sharing options...
alum316 Posted July 17, 2005 Share Posted July 17, 2005 I did this: Notes: I'm using OsC 2.2MS2, phpMyAdmin Under phpMyAdmin, I went to my oscommerce table, hit SQL, and put this ins the run query box: DROP TABLE IF EXISTS countries; CREATE TABLE countries ( countries_id int NOT NULL auto_increment, countries_name varchar(64) NOT NULL, countries_iso_code_2 char(2) NOT NULL, countries_iso_code_3 char(3) NOT NULL, address_format_id int NOT NULL, PRIMARY KEY (countries_id), KEY IDX_COUNTRIES_NAME (countries_name) ); INSERT INTO countries VALUES (223,'United States','US','USA', '2'); Keep in mind my site isn't live yet so I don't know if leaving it number 223 caused any problems...I left it that way in case I ever want to add the other countries back in. If you want to add any other country, go dig out your oscommerce.sql file, go to the insert into countries section, copy the lines for the countries you want, and stick them in the code above with the US insert command. Link to comment Share on other sites More sharing options...
infoaddi Posted November 8, 2005 Share Posted November 8, 2005 Look what a search for "delete countries" and +delete +countries brought me:..... ..... ..... NOTHING Also, the above link is no longer valid. The search feature has been sucking lately. I spend hours trying to rig searches to work right for something that should take a few minutes to find. I agree, the same things come up even though I try different keywords. Link to comment Share on other sites More sharing options...
svelletri Posted November 14, 2005 Share Posted November 14, 2005 I set a filter on my site. I just added another column to the Countries table called Show_Country and then marked the ones that I wanted to include. Then I just added a Where clause to the SQL statement in the tep_get_countries function: Add a new column to the Countries table called show_country. Make it an Int field, size 11, default value 0 Then mark the countries that you want to show in your drop-down list by putting a 1 in their show_country field. Edit the tep_get_countries function in includes/functions/general.php. Around line number 239, look for: ? ? $countries = tep_db_query("select countries_id, countries_name from " . TABLE_COUNTRIES . " order by countries_name"); and add a where clause to it: $countries = tep_db_query("select countries_id, countries_name from " . TABLE_COUNTRIES . " where show_country=1 order by countries_name"); You could probably do the same with the States. Sorry I am a newby and any help would be appreciated. I understood the changes to the PHP code but how do I go about adding the Show_Country Column to the Countries table? Cheers Steven Link to comment Share on other sites More sharing options...
tmgrood Posted November 15, 2005 Share Posted November 15, 2005 Sorry I am a newby and any help would be appreciated. I understood the changes to the PHP code but how do I go about adding the Show_Country Column to the Countries table? Cheers Steven I removed the countries I didnt need by going to my Admin/Locations/Countries. Didnt have to mess with any codes. I'm a victim of circumstance Link to comment Share on other sites More sharing options...
kru Posted November 17, 2005 Share Posted November 17, 2005 There are a LOT of countries in that table!! 10+ pages, to be exact. I only wanted the US and Canada. I started deleting manually through the Admin tool and decided it took WAY too long, so I did a little research. I was able to delete ALL countries and re-enter only the two that I wanted VERY easily. Here's what I did: Go to phpMyAdmin (and sign in of course) Expand the tree at the left (click on + sign) Click on 'Countries' (Layout of Countries table will then be displayed) Click on 'Empty' tab towards the top right of the page (All countries are now gone) Go back to OsCommerce Admin Go to Locations/Taxes>Countries Click on the 'New Country' button Complete the fields Click on 'Insert' button (Repeat previous three steps for each additional country you want to add) Whoila!! MUCH easier/faster than deleting 200 (@) countries one by one... Add-Ons personally installed:Step by Step Manual Order -- Request Reviews -- Reviews in Product Listing -- Reviews in Product Display -- Review Approval System -- Leverage Browser Cache --Header Tag Controller -- Multilayer SEO Pop Out Menu -- Follow Us Box -- View All Products -- USPS Shipping Labels -- UPS Shipping Labels -- Monthly Sales/Tax Report --htacess Optimisation -- Remove Unused Images -- Master Password -- Admin Change Customer Password -- Database Backup Manager -- Zero Stock Report --Searchbox Search In Descriptions -- Easy Populate 2.76i -- Barcode Rendering -- Admin Sort By Model -- Products Purchased ReportAdd-Ons personally developed:Search for email address, etc in Orders -- Discontinue ProductAdd-Ons installed by others:View Counter -- Site Monitor -- Image Thumbnailer -- Database Optimizer -- Recaptcha -- Discount Coupons -- Add More Fields Link to comment Share on other sites More sharing options...
tmgrood Posted November 18, 2005 Share Posted November 18, 2005 There are a LOT of countries in that table!! 10+ pages, to be exact. I only wanted the US and Canada. I started deleting manually through the Admin tool and decided it took WAY too long, so I did a little research. I was able to delete ALL countries and re-enter only the two that I wanted VERY easily. Here's what I did: Go to phpMyAdmin (and sign in of course) Expand the tree at the left (click on + sign) Click on 'Countries' (Layout of Countries table will then be displayed) Click on 'Empty' tab towards the top right of the page (All countries are now gone) Go back to OsCommerce Admin Go to Locations/Taxes>Countries Click on the 'New Country' button Complete the fields Click on 'Insert' button (Repeat previous three steps for each additional country you want to add) Whoila!! MUCH easier/faster than deleting 200 (@) countries one by one... Good Job. Great when people put their solutions. Where were ya when I deleted those 200 countries one by one. hehe :blush: I'm a victim of circumstance Link to comment Share on other sites More sharing options...
Squintz Posted November 28, 2005 Share Posted November 28, 2005 I set a filter on my site. I just added another column to the Countries table called Show_Country and then marked the ones that I wanted to include. Then I just added a Where clause to the SQL statement in the tep_get_countries function: Add a new column to the Countries table called show_country. Make it an Int field, size 11, default value 0 Then mark the countries that you want to show in your drop-down list by putting a 1 in their show_country field. Edit the tep_get_countries function in includes/functions/general.php. Around line number 239, look for: ? ? $countries = tep_db_query("select countries_id, countries_name from " . TABLE_COUNTRIES . " order by countries_name"); and add a where clause to it: $countries = tep_db_query("select countries_id, countries_name from " . TABLE_COUNTRIES . " where show_country=1 order by countries_name"); You could probably do the same with the States. I just wanted to say thank you for this tip. It worked out perfectly. Modules installed: http://www.oscommerce.com/forums/index.php?showtopic=57259 - Options attributes - wysiwyg editor - cats on main page - policies and terms Link to comment Share on other sites More sharing options...
AlanR Posted November 28, 2005 Share Posted November 28, 2005 I just wanted to say thank you for this tip. It worked out perfectly. 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')); I just commented out the original line to keep it as a reference. You can change the country id and the text in this line to make any country appear by default. Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management) Link to comment Share on other sites More sharing options...
zoltar Posted December 6, 2005 Share Posted December 6, 2005 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')); I just commented out the original line to keep it as a reference. You can change the country id and the text in this line to make any country appear by default. Rock on, AlanR! Thanks for this tip. Definitely a time saver not having to delete 12 pages of countries one by one (and since I can't seem to access phpMyAdmin, I couldn't go that route). Link to comment Share on other sites More sharing options...
AlanR Posted December 6, 2005 Share Posted December 6, 2005 You can download and install phpMyAdmin from here: http://www.phpmyadmin.net/home_page/index.php It's not hard to install, just make sure you password protect the directory it lives in. Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management) Link to comment Share on other sites More sharing options...
vondada Posted January 7, 2006 Share Posted January 7, 2006 Dude. This was such a simple and easy to use mod. Thanks for posting it. It's saved me a ton of work. Link to comment Share on other sites More sharing options...
steelwidow Posted March 9, 2006 Share Posted March 9, 2006 thanks so much! I totally was looking for how to set the default country for instance, USA... ROCK ON! Link to comment Share on other sites More sharing options...
bsienk Posted March 15, 2006 Share Posted March 15, 2006 My question is not exactly the same, but almost: I don't want to delete or suppress any countries. The store I'm working with is fine with shipping International orders, in this case outside the US. However, there are some items they sell which they do not want to export either due to high shipping cost or customs/export restrictions. Thus, the question: Is there a way to keep all the countries, but mark some products as only being able to be sold domestically, while other products can be sold anywhere? Link to comment Share on other sites More sharing options...
bsienk Posted March 15, 2006 Share Posted March 15, 2006 My question is not exactly the same, but almost: I don't want to delete or suppress any countries. The store I'm working with is fine with shipping International orders, in this case outside the US. However, there are some items they sell which they do not want to export either due to high shipping cost or customs/export restrictions. Thus, the question: Is there a way to keep all the countries, but mark some products as only being able to be sold domestically, while other products can be sold anywhere? Never mind, I typed too soon -- just found this: http://www.oscommerce.com/community/contributions,2173 Link to comment Share on other sites More sharing options...
Guest Posted December 9, 2006 Share Posted December 9, 2006 Wow, how awesome! Thanks :D Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.