Is there a faster way of disabling countries? Then going into each one, selecting disable and saving.
Using opencart 3.0.3.2 - PHP 7.4 - Standard Template - Add to Cart Enable Disable Out of Stock Product 3.x - Export/Import Tool (V3.22) for OpenCart 3.x - Footer Social Media Link( 3.x ) v1.0
You could write an sql query but then your going to have to add all the country names you want to disable them anyway.
That could be done by grabbing the countries from a simple txt list and changing the status in the DB
by the time you create the list, write the sql, mess it up a time or two - you could have done it manually anyway :-)
Good thing is you only have to do it once.
If you are absolutely sure you will never ever need those countries you could do a multiple delete.
But you have to delete the zones first - you cannot delete a country that is assigned to zones
Have you checked to see if there is an extension to help - this must have come up hundreds of times I think
Also remember to use geozones effectively and it becomes less important to disable countries
Multiple possibilities can be chose and considered for these types of request:
- viewtopic.php?f=202&t=220373&p=801725#p801723
- and starting here: viewtopic.php?f=202&t=211632&p=754597#p754778 .
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I certainly have been asked no end when these country situations crop up with that amount of countries.
It would seem logical to have the exact reverse in that all countries are disabled as default and enable what you need.
or at least include continental zones etc. It is a question for straighlight really as I guess this has almost certainly been discussed.
It would be pretty easy to come up with a way to disable all countries in 1 query, then manually from admin enable what you need.
It would then become problematic to handle extensions that are using geographic zones, for instance, with payment extension, shipping extension, and total extension modules where all zones are selected. Granted, the queries would follow along systematically. However, it's the admin users that might not follow the same path that easily as to know which of these geographic settings have been disabled altogether in order to re-enable all these settings one-at-a-time which means, in the end, it would then be as an equally encountered situation than simply disabling them one-by-one.mikeinterserv wrote: ↑Mon Feb 08, 2021 8:45 amHad a trawl through all that and a number of others, This is probably near a no1 question from a lot of shop owners.
I certainly have been asked no end when these country situations crop up with that amount of countries.
It would seem logical to have the exact reverse in that all countries are disabled as default and enable what you need.
or at least include continental zones etc. It is a question for straighlight really as I guess this has almost certainly been discussed.
It would be pretty easy to come up with a way to disable all countries in 1 query, then manually from admin enable what you need.
Besides, the Opencart admin core model does not have the distinction integrated where all geographic countries and zones must match accordingly. They're almost all running independently and aside from each other when deleting a country or a zone out-of-the-box.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I see exactly what you say.
A hidden minefield can be disarmed once you know the combination whereas geographic extensions cannot be disarmed that easily once the counted rows are affected on the database and until the users do find the root cause.mikeinterserv wrote: ↑Mon Feb 08, 2021 9:42 amIts a bit like a hidden minefield - it doesn't seem much till you get into it. :-)
I see exactly what you say.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Looks like I'll be manually disabling each one. Then I can enable them as the website grows.
Using opencart 3.0.3.2 - PHP 7.4 - Standard Template - Add to Cart Enable Disable Out of Stock Product 3.x - Export/Import Tool (V3.22) for OpenCart 3.x - Footer Social Media Link( 3.x ) v1.0
Why you don't this with the SQL command?
Code: Select all
UPDATE `oc_country` SET `status` = '0';
Code: Select all
UPDATE `oc_country` SET `status` = '0' WHERE `country_id` <> 'X';
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Is there a easily way to double check all countries required have been disabled?
Using opencart 3.0.3.2 - PHP 7.4 - Standard Template - Add to Cart Enable Disable Out of Stock Product 3.x - Export/Import Tool (V3.22) for OpenCart 3.x - Footer Social Media Link( 3.x ) v1.0
How many countries you use (you want enabled) ?
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Using opencart 3.0.3.2 - PHP 7.4 - Standard Template - Add to Cart Enable Disable Out of Stock Product 3.x - Export/Import Tool (V3.22) for OpenCart 3.x - Footer Social Media Link( 3.x ) v1.0
If you want to use only UK, then disable all countries except UK
Code: Select all
UPDATE `oc_country` SET `status` = '0' WHERE `country_id` <> '222';
And to understand:
< - all countries ID untill 222
> - all countries ID after 222
So is just one (1) command.
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
I really have to learn SQL.
Using opencart 3.0.3.2 - PHP 7.4 - Standard Template - Add to Cart Enable Disable Out of Stock Product 3.x - Export/Import Tool (V3.22) for OpenCart 3.x - Footer Social Media Link( 3.x ) v1.0
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Users browsing this forum: No registered users and 132 guests