Author Topic: How to remove all countries and zones except 1  (Read 1811 times)

Offline 247soups

  • Newbie
  • *
  • Posts: 1
  • Karma: +1/-0
    • View Profile
How to remove all countries and zones except 1
« 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

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 4425
  • Karma: +206/-0
    • View Profile
Re: How to remove all countries and zones except 1
« Reply #1 on: August 21, 2017, 01:11:18 AM »
Hello.

Why not disable them?
“Chuck Norris is so amazing.”
― Mother Teresa

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4164
  • Karma: +252/-9
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: How to remove all countries and zones except 1
« Reply #2 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.
We need your help to build better free open source eCommerce platform for everyone.
See how you can help

 

Powered by SMFPacks Social Login Mod