Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / How to wipe clean all categories? with EP or otherwise?

How to wipe clean all categories? with EP or otherwise?

Views: 652

Results 1 to 4 of 4
17 May 2013, 10:16 AM
#1
goodfriendsam avatar

goodfriendsam

New Zenner

Join Date:
May 2013
Location:
New London CT
Posts:
2
Plugin Contributions:
0

How to wipe clean all categories? with EP or otherwise?

After multiple Easy Populate Upload updates, my products, which model numbers shifted around a couple times, now all have too many categories, and the wrong categories.

For example, product A used to be category 1 before the update; was category 2 after the update, but is now listed as both category 1 and 2 (let alone 3 and 4). It's a supplement store, so vitamin B whatever is now listed with the enemas, coconut oil is listed with olive oil, etc etc.

Wondering how to wipe the slate clean to reupload categories with easy populate? Have thousands of products, so doing it manually is not an option. I'm new and a bit skiddish about using phpmyadmin, but I understand that might be necessary.

Again, I want to delete the categories, but all other product information is fine.

Thank you.

http://www.groundedliving.net/onlinestore is the site (still under construction, and I hid the category cloud because it's so dysfunctional)

17 May 2013, 5:08 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How to wipe clean all categories? with EP or otherwise?

I want to delete the categories, but all other product information is fine.
One can not delete the categories as they contain products which require belonging to some category

18 May 2013, 2:01 AM
#3
goodfriendsam avatar

goodfriendsam

New Zenner

Join Date:
May 2013
Location:
New London CT
Posts:
2
Plugin Contributions:
0

Re: How to wipe clean all categories? with EP or otherwise?

Thanks Kobra; appreciative of any ideas on how to navigate my dilemma.

18 May 2013, 2:33 AM
#4
drbyte avatar

drbyte

Sensei

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

Re: How to wipe clean all categories? with EP or otherwise?

This SQL script will delete all categories except the lowest-numbered one, and re-assign all products to that category. Then you can manually add more categories and move products into those other categories.

SET @t1=0;
SELECT (@t1:= min(categories_id)) as t1 from categories;
delete from categories where categories_id != @t1;
delete from categories_description where categories_id != @t1;
truncate table products_to_categories;
insert into products_to_categories (products_id, categories_id) select products_id, @t1 from products;
update products set master_categories_id = @t1;
optimize table products, categories, categories_description;

Hopefully your site isn't using tablename prefixes. If it is, you'll need to adjust every tablename accordingly.