AbanteCart Community

AbanteCart Development => Customization help => Topic started by: 247soups on August 20, 2017, 01:44:45 PM

Title: How to remove all countries and zones except 1
Post by: 247soups on August 20, 2017, 01:44:45 PM
I will like to get help on how I can remove all countries.
It wasn't easy to remove countries on more than 120 pages.

How can I do it easily?
While trying to remove 10 countries each, I got an error that zone is attached to the countries.

I need to remove then all.


Thanks in advance
Title: Re: How to remove all countries and zones except 1
Post by: Basara on August 21, 2017, 01:11:18 AM
Hello.

Why not disable them?
Title: Re: How to remove all countries and zones except 1
Post by: abantecart on August 27, 2017, 03:05:55 PM
Welcome to AbanteCart 247soups!

The fastest way to delete all countries is to delete records from the database.
Look at following tables:
ac_countries
ac_country_descriptions
ac_zones

Something like:
Code: [Select]
DELETE ac_countries, ac_country_descriptions,  ac_zones
FROM ac_countries c
INNER JOIN ac_country_descriptions cd ON c.country_id = cd.country_id
INNER JOIN ac_zones z ON c.country_id = z.country_id
WHERE c.country_id in (1, 2, ...)

Check your prefix for the tables and included needed country_id in the WHERE clause list

After you do this, do not forget to clear all cache.