Forums / Setting Up Categories, Products, Attributes / I need to create a set of sub categories for each top level category

I need to create a set of sub categories for each top level category

Started by nick1973 on 22 Feb 2013, 9:43 AM · Views: 1,194

Results 1 to 2 of 2
22 Feb 2013, 9:43 AM
#1
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

I need to create a set of sub categories for each top level category

Hi I need to create a set of sub categories for each top level category like this.

Category 1 - Sub Category 1 - 250, 500, 750, 1250, 2500, 5000, 10000

Category 1 - Sub Category 1 - 250, 500, 750, 1250, 2500, 5000, 10000

Category 1 - Sub Category 1 - 250, 500, 750, 1250, 2500, 5000, 10000

Category 1 - Sub Category 1 - 250, 500, 750, 1250, 2500, 5000, 10000

Category 1 - Sub Category 2 - 250, 500, 750, 1250, 2500, 5000, 10000

Category 1 - Sub Category 2 - 250, 500, 750, 1250, 2500, 5000, 10000

Category 1 - Sub Category 2 - 250, 500, 750, 1250, 2500, 5000, 10000

Category 1 - Sub Category 2 - 250, 500, 750, 1250, 2500, 5000, 10000

etc

I have quite alot of categories so ideally I would like to create these sub categories easily inside the database to save me alot of time.

Also I have products inside Sub Category 1 and Sub Category 2. 250, 500, 750, 1250, 2500, 5000, 10000 are category names that refer to the quantities of the products previously in Sub Category 1 and Sub Category 2.

So I need to move products from Sub Category 1 and Sub Category 2 inside the quantity categories as I realise you cannot have categories and products together inside the same category.

So I need to move products from Sub Category 1 inside the 250 category and duplicate those products across all quantity categories.

After that I need to update each individual products quantity.

So ideally I need a way to do this inside the database quickly and easily.

Also I would like to know if there's a way that I could easily add the quantity to my product name across all products. Each product already has a name so I just need to add the quantity inside the names. The above is more important though for now.

Thanks

Nick

Nick Smith - Venture Design and Print
https://venturedesignandprint.co.uk

22 Feb 2013, 5:04 PM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: I need to create a set of sub categories for each top level category

To do this with a SQL query will not be easy. The "parent ID <-> Category ID" relationship is a complex one in zencart. (A "child" category (sub-category) becomes a "parent" category as well, when a sub-sub-category is added to it.)

Writing this to the two tables involved is not going to be easy - and moreso in your case where the sub-cats are identically named in a lot of instances.

It can be done... but will take some very detailed planning.

20 years a Zencart User