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.
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.
Execute this sql in your phpmyadmin
Code: Select all
delete from country where country_id <> 223;
delete from zone where country_id <> 223;
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.
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.
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?Qphoria wrote:Execute this sql in your phpmyadminCode: Select all
delete from country where country_id <> 223; delete from zone where country_id <> 223;
Thanks for any advice...
....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.
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.
lol yes, you're 100% accurate: it was about 1 sec to execute - but add 4 secs to type the query! So easy it was unnerving..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
I want the all to be Disabled instead of Deleted.
Anyone?
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.
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.JAY6390 wrote:Not looked at the tables, but I'm guessing there's a status field, which would beCode: Select all
UPDATE country SET status = 0 WHERE country_id <> 223; UPDATE zone SET status = 0 WHERE country_id <> 223;
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.
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.
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.
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.
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.
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.
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?
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?
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.
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.
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.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..
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!
( 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!
Who is online
Users browsing this forum: Ahrefs [Bot] and 12 guests