Author Topic: How to remove all countries and zones except 1  (Read 5307 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: 5776
  • Karma: +274/-2
    • 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?

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4358
  • Karma: +298/-10
    • 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.
Please  rate your experience or leave your review
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