Post by vvinyl » Tue Aug 07, 2018 2:28 am

Is there any way to mass disable several countries and zones at a time?
I see that I can check them and mass delete, but I didn't want to do that in case I decide to ship internationally at some point in the future.

I started going through them and disabling each one at a time, but that is going to take forever.
Has anyone found a simple solution other than deleting?

Also, I tried to check all the ones I wanted to delete and when it went through I got an error that said
'Warning: This zone cannot be deleted as it is currently assigned to 1 address book entries!'

I can't find an address book so I can take this off. Does anyone know any fixes, solutions?

Thanks

Newbie

Posts

Joined
Tue Aug 07, 2018 2:25 am

Post by Johnathan » Tue Aug 07, 2018 10:23 pm

The fastest way to do it is directly through the database, where you can disable all countries at once. For example, if you ran this query, it would disable all countries, and then you could re-enable the two you want:

Code: Select all

UPDATE oc_country SET `status` = 0;

You should double-check the table name in your database, since you may have a different prefix than oc_

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by nastydwarf » Wed Aug 08, 2018 1:00 am

Thanks for this info! When you run the query does it update quickly? i keep updating mine and when i go back in i noticed they are enabled.

Newbie

Posts

Joined
Tue Aug 07, 2018 10:57 pm

Post by straightlight » Wed Aug 08, 2018 1:46 am

Depending on the server's resource, using an update query can normally go up to 500 rows. If lower, then we could be looking at a high resource usage of your mySQL server, an old PHP / mySQL server libraries installed.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Johnathan » Wed Aug 08, 2018 5:01 am

It should be super fast, there are only 239 ~ 257 countries in a standard OpenCart installation. Mine takes less than 1 second to do it, so if yours isn't working, then it's probably not being run correctly.

Double-check the database table prefix (which is "oc_" by default, but might be something different in your installation) and double-check that you're clicking the correct button in your database editor (e.g. phpMyAdmin) to actually run the query. If you still have issues after that, I'd maybe ask your host to attempt it, and make sure that phpMyAdmin is working correctly.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by bird372 » Sun Apr 24, 2022 7:39 pm

Johnathan wrote:
Tue Aug 07, 2018 10:23 pm
The fastest way to do it is directly through the database, where you can disable all countries at once. For example, if you ran this query, it would disable all countries, and then you could re-enable the two you want:

Code: Select all

UPDATE oc_country SET `status` = 0;

You should double-check the table name in your database, since you may have a different prefix than oc_
thank you very much , your solution helped me

Newbie

Posts

Joined
Sat Nov 27, 2021 8:39 pm

Post by NavyUnsob » Fri Mar 08, 2024 12:32 pm

Johnathan wrote:
Tue Aug 07, 2018 10:23 pm
The fastest way to do it is directly through the database, where you can disable all countries at once. For example, if you ran this query, it would disable all countries, and then you could re-enable the two you want:

Code: Select all

UPDATE oc_country SET `status` = 0;

You should double-check the table name in your database, since you may have a different prefix than oc_ Kia Finance Login


Thank you @Johnathan for this help this is so helpful for me thank you again.

Newbie

Posts

Joined
Fri Mar 08, 2024 12:22 pm
Who is online

Users browsing this forum: No registered users and 25 guests