Post by actionmedia » Mon Nov 23, 2009 11:56 am

Hello,

I've searched and searched the forum however have been unsuccessful at trying to resolve an issue I'm having.

I just installed opencart and am configuring it. Everything works great, except I want to remove ALL countries and only allow USA. I tried deleting the countries, but kept getting errors stating that they're linked to a zone. I'm not sure what else to try.

Any input would be appreciated.

Thank you.

Newbie

Posts

Joined
Mon Nov 23, 2009 11:53 am

Post by Qphoria » Mon Nov 23, 2009 12:09 pm

Execute this sql in your phpmyadmin

Code: Select all

delete from country where country_id <> 223;
delete from zone where country_id <> 223;

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by actionmedia » Mon Nov 23, 2009 12:21 pm

Excellent! Thanks a lot!

Newbie

Posts

Joined
Mon Nov 23, 2009 11:53 am

Post by reedmeier@gmail.com » Wed Jan 20, 2010 3:43 pm

I am looking at phpmyadmin on my server, but do not know how to execute the prior post which says to "Execute sql in your phpmyadmin" Do I cut and paste it somewhere or run something. Sorry, I'm a newb. ;D


Posts

Joined
Wed Jan 13, 2010 11:41 pm

Post by dbstr » Wed Jan 20, 2010 3:55 pm

Login to phpMyAdmin, select your database, click the "SQL"-tab in the main frame and you will get a form where you can enter queries ;-)

Request Reviews v1.0 released.


Active Member

Posts

Joined
Sun Aug 30, 2009 12:20 am

Post by Moggin » Sat Jul 03, 2010 8:17 am

Qphoria wrote:Execute this sql in your phpmyadmin

Code: Select all

delete from country where country_id <> 223;
delete from zone where country_id <> 223;
Is this still the best way to remove all but one country (using 1.4.8b)? If it's the UK, which number do I need?
Thanks for any advice...

Active Member

Posts

Joined
Wed May 05, 2010 4:56 am

Post by Moggin » Sun Jul 11, 2010 12:43 am

....well, I'm big on self-help, :) so if this helps anyone else:

For the UK, it's 222 (in 1.4.8b); yes, this does remove all countries and zones except the UK, and since it takes about 5 seconds max, is a lot faster than ploughing through the geo-zones and countries in the backoffice. It's a bit scary though, so backup first.

Active Member

Posts

Joined
Wed May 05, 2010 4:56 am

Post by JAY6390 » Sun Aug 01, 2010 6:23 pm

that query on any regular server shouldn't take more than a second to execute, I'm guessing it took longer for the request and the page refresh than it did for the query to execute

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by Moggin » Sun Aug 01, 2010 8:28 pm

JAY6390 wrote:that query on any regular server shouldn't take more than a second to execute, I'm guessing it took longer for the request and the page refresh than it did for the query to execute
lol yes, you're 100% accurate: it was about 1 sec to execute - but add 4 secs to type the query! :laugh: So easy it was unnerving..

Active Member

Posts

Joined
Wed May 05, 2010 4:56 am

Post by i2Paq » Sun Aug 01, 2010 9:47 pm

I want the all to be Disabled instead of Deleted.

Anyone?

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by JAY6390 » Sun Aug 01, 2010 10:49 pm

Not looked at the tables, but I'm guessing there's a status field, which would be

Code: Select all

UPDATE country SET status = 0 WHERE country_id <> 223;
UPDATE zone SET status = 0 WHERE country_id <> 223;

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by poorlittlefish » Fri Sep 03, 2010 3:29 am

JAY6390 wrote:Not looked at the tables, but I'm guessing there's a status field, which would be

Code: Select all

UPDATE country SET status = 0 WHERE country_id <> 223;
UPDATE zone SET status = 0 WHERE country_id <> 223;
This works on v1.4.9 - thanks very much.

By the way, remember that if you've got any kind of prefix on your database tables you'll need to change 'country' and 'zone' to whatever your tables are called.


Posts

Joined
Thu Sep 02, 2010 3:45 pm

Post by Moggin » Fri Sep 03, 2010 4:36 am

This is about a month late, but THANKS from me too, Jay. That 'disable' query works perfectly, and I prefer it to the 'delete' solution.
So, for any other noobs out there applying this fix for the UK, the above code needs to change to 222, and you're sorted.

I'm not sure why, but you have to go into the admin panel, open and 'save' one of the disabled countries and zones, for the changes to show in the shop.

Active Member

Posts

Joined
Wed May 05, 2010 4:56 am

Post by i2Paq » Fri Nov 12, 2010 1:51 am

Works on 1.4.9.2, Netherlands: 150

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by Qphoria » Fri Nov 12, 2010 10:58 am

I added status in 1.4.8 so that should work for all versions since then.
I am going to look into more mass-edit/mass-toggle options in 1.5.0 or 1.5.1

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by rocketero » Sat Mar 19, 2011 10:40 pm

After disabling (Status = 0) all countries and zones, except for the country/zone of store's location, still a customer can add/create an account with an address residing in any country, except that the region/province does show empty.

I thought that after disabling all countries/zones except for the one of business, the account/create or the account/address(insert) wouldn't show those countries already with status = 0.

New member

Posts

Joined
Tue Feb 01, 2011 9:22 pm

Post by FnF » Sat Mar 19, 2011 11:25 pm

If your still seeing other countries in the list you might not have executed the SQl query properly. But someone mentioned somewhere, having to click edit on one of the disabled countries and then saving again in order for the deletee countries to stop showing.
I dont know what that would do, and I didnt have to do it, but did you try it?

The other thing, if your using only one country, have you created a Geo Zone for that country?

User avatar
FnF
Active Member

Posts

Joined
Sat Mar 19, 2011 9:59 pm

Post by rocketero » Sun Mar 20, 2011 6:50 am

now is working, but after executing a sql query to delete all countries except for the one I needed.

Before I did what you mentioned, I clicked on a disabled country and saved it again, that didn't do it for me, and after deleting the countries then it worked, and I did already had created a geo-zone for my country.
So all good now. thanks.

New member

Posts

Joined
Tue Feb 01, 2011 9:22 pm

Post by Moggin » Sun Mar 20, 2011 9:50 am

FnF wrote:.. click edit on one of the disabled countries and then saving again in order for the deletee countries to stop showing. I dont know what that would do..
No, me neither. ;) But after disabling the countries/zones in the DB they still appeared in the drop down. When I carried out that strange procedure, all was well again. Maybe it's a cache thing.

Active Member

Posts

Joined
Wed May 05, 2010 4:56 am

Post by Adisan » Wed Mar 23, 2011 2:28 am

Moggin is right; if the countries do not show in the dropdown menu

( even after you did run this code:

UPDATE country SET status = 0 WHERE country_id <> 223;
UPDATE zone SET status = 0 WHERE country_id <> 223;)
,
just delete all the files in the system/cache folder except the index.html, that should solve it; in my case did.
And thanks for the help guys, I appreciate it!

Newbie

Posts

Joined
Wed Mar 23, 2011 2:02 am
Who is online

Users browsing this forum: Ahrefs [Bot] and 12 guests