Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Link category similar to linking products?

Link category similar to linking products?

Locked

Views: 1,083

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
4 Apr 2007, 2:29 AM
#1
wolfsz avatar

wolfsz

Zen Follower

Join Date:
Mar 2006
Location:
Australia
Posts:
286
Plugin Contributions:
3

Link category similar to linking products?

Hi there
I'm trying to improve my store by providing different paths to products eg via a product centric and market centric approach.
I have several categories that need to appear as sub categories under different parent categories eg
For Commercial -> Hinges
For Residential -> Hinges

Since Hinges itself has sub cats: Aluminum, S/S Butt, S/S Easyfit etc. I don't want to have to recreate all the folder and then link all the products in all the sub cats.

Any ideas?

4 Apr 2007, 8:19 PM
#2
wolfsz avatar

wolfsz

Zen Follower

Join Date:
Mar 2006
Location:
Australia
Posts:
286
Plugin Contributions:
3

Re: Link category similar to linking products?

Just in case you require this functionality too, he is what I've done. Please note this is a "manual" solution and is only recommened if you know SQL. OK my approach was to simply have multiply entires into the categories table for the same category. There are two columns in this table that determine the category structure of your site categories_id and parent_id. In the orinal table categories_id is the primary key and there a cat # can only appear once: eg
cat_id parent_id
1 129
2 129
3 129
is allowed but
cat_id parent_id
25 2
25 129
is not. By changing the primary key from categories_id to include also the parent_id this is now allowed, however you have to manually add the new entries to the categories table.
SQL code to change the primary key is (backup table first!):
alter table categories drop primary key, add constraint primary key (categories_id, parent_id)