Zen Cart Logo
Forums / General Questions / Deleted all countries and now I cannot delete old customers

Deleted all countries and now I cannot delete old customers

Locked

Views: 2,704

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
22 Feb 2010, 9:10 PM
#1
whatisthat456 avatar

whatisthat456

New Zenner

Join Date:
Dec 2009
Posts:
33
Plugin Contributions:
0

Deleted all countries and now I cannot delete old customers

I went through and deleted all the countries one by one and forgot to skip over USA and now I cant remember what should be in the spots for ISO codes 2 and 3 and address format?

22 Feb 2010, 9:23 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Deleted all countries and now I cannot delete old customers

US and USA

22 Feb 2010, 9:25 PM
#3
whatisthat456 avatar

whatisthat456

New Zenner

Join Date:
Dec 2009
Posts:
33
Plugin Contributions:
0

Re: Deleted all countries and now I cannot delete old customers

What is the address format?

22 Feb 2010, 9:27 PM
#4
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Deleted all countries and now I cannot delete old customers

Address format is 2.

22 Feb 2010, 9:30 PM
#5
whatisthat456 avatar

whatisthat456

New Zenner

Join Date:
Dec 2009
Posts:
33
Plugin Contributions:
0

Re: Deleted all countries and now I cannot delete old customers

Thanks so much. Now I have a problem that since I just deleted all the other countries my customers that were from outside the USA I cant seem to delete them from my customers page in admin?

22 Feb 2010, 9:47 PM
#6
whatisthat456 avatar

whatisthat456

New Zenner

Join Date:
Dec 2009
Posts:
33
Plugin Contributions:
0

Re: Deleted all countries and now I cannot delete old customers

I had received a international order and then noticed I had all the countries still active. So i deleted all the countries except USA and now I go into the admin/customers and cannot delete the any customers and this shows whenever I click on of the customers.

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/****/public_html/admin/customers.php on line 1099

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/****/public_html/admin/customers.php on line 1101

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/****/public_html/admin/includes/classes/object_info.php on line 29

Warning: Variable passed to each() is not an array or object in /home/****/public_html/admin/includes/classes/object_info.php on line 30

22 Feb 2010, 9:55 PM
#7
whatisthat456 avatar

whatisthat456

New Zenner

Join Date:
Dec 2009
Posts:
33
Plugin Contributions:
0

Re: Deleted all countries and now I cannot delete old customers

The warning are shown for all previous customers but I have created a new test customer and the warning are not displayed for it. I just need to delete all my old customers manually if there is a way?

23 Feb 2010, 12:47 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Deleted all countries and now I cannot delete old customers

By deleting the country record, you've actually broken EVERY customer who has that country set in their address books.
Merely adding the country back again DOES NOT fix the problem, because your new record gets a new record number, which doesn't match the numbers stored internally in all the address books.
It would be a good lesson to have you restore your countries database table, putting things back in their good functional state. But, by the sound of your posts that's way beyond your level of knowledge with databases. I recommend you start making regular database backups, as a start.

In the interim, the following might work, assuming you have added back a country record for USA. This overrides the internal tracking managed by the database, and should relink the customer addresses to the broken USA record you added:

  1. Go to Admin->Tools->Install SQL Patch
  2. Copy-and-paste the following into the big text field, and click Send.```
    update countries set countries_id=223 where countries_iso_code_3 = 'USA';
3. Go to your customers page and check whether your US customers can be accessed properly.
23 Feb 2010, 5:18 AM
#9
whatisthat456 avatar

whatisthat456

New Zenner

Join Date:
Dec 2009
Posts:
33
Plugin Contributions:
0

Re: Deleted all countries and now I cannot delete old customers

I did what you said to do in your post and that allowed me to access the old accounts. But now the accounts that I had created after deleting all the countrys are now showing the warnings. How can I simply delete the 2 accounts as they are just test accounts I made to try to figure out if the warnings would show on new accounts.

23 Feb 2010, 5:37 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Deleted all countries and now I cannot delete old customers

I'm confused. First, you said you wanted to delete 2 customers. Then you said you wanted to delete all your customers. Then you said you wanted to delete all your old customers. And now you're saying you just want to delete 2 test accounts.

23 Feb 2010, 6:16 AM
#11
whatisthat456 avatar

whatisthat456

New Zenner

Join Date:
Dec 2009
Posts:
33
Plugin Contributions:
0

Re: Deleted all countries and now I cannot delete old customers

Ok, let me try to re explain this..At first I wanted to delete all of my customers but before your reply I had created 2 new test customers. Then I had read your reply and followed your directions, which allowed me to access and delete all accounts besides the 2 new test customers that I had created. So I am left with only 2 customers and they are just test customers. I just need to delete the 2 test customers and I will be back to 0 customers and all will be well. Im sorry for the confusion it is just hard for me to explain this.

23 Feb 2010, 6:35 AM
#12
whatisthat456 avatar

whatisthat456

New Zenner

Join Date:
Dec 2009
Posts:
33
Plugin Contributions:
0

Re: Deleted all countries and now I cannot delete old customers

I just entered "truncate table customers;" into Install SQL patches and hit send and now im done.

23 Feb 2010, 6:44 AM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Deleted all countries and now I cannot delete old customers

Sure, and now you have orphaned address book records in the address_book table, and orphaned customer_info in the customer_info tables, meaning that when you go to create new customers, you run the risk of getting things royally mucked up.
You'll need to truncate those 2 tables as well. And, if you had any group-discounts connected to them, you'll need to truncate that table, too.