Page 1 of 1
Add Categories direct to database using t-sql
Posted: Wed Feb 27, 2008 2:43 pm
by svetalex
I added new categories to database into ac_Categories table and also into ac_CategoryParents table using the rules discovered from early added sample categories. I check these two table - a data presents correctly. However, I cannot see the newly added categories neither in Store UI neither in Admin Catalog Browser. What's wrong ? Might be I need to add record(s) into some additional table(s), or its just impossible to add categories directly to database? Or might be I need to use ONLYAblecommerce objects?
Posted: Wed Feb 27, 2008 6:27 pm
by AbleMods
It's possible but I would highly recommend using the Able methods.
Otherwise you risk something (incorrect) going unnoticed until weeks after going live and it'll be a nightmare to clean up. I speak from experience.
What you missed is adding entries in the ac_CatalogNodes table. It is also part of the category table set.
Able has some well-designed methods that can automatically create the catalog tree, even if you've specified sub-categories. It will even give you the option to search for a particular category tree branch and if it doesn't exist, automatically create it.
ac_CatalogNodes table - ??
Posted: Thu Feb 28, 2008 7:40 am
by svetalex
Thanks, that thought cross my mind too, but I opened the ac_CatalogNodes table, it looks like link table between Categories and Products. I cannot see the way how to add categories into it. I’ll try to use Able methods, just want to investigate the Ablecommerce structure.
Posted: Thu Feb 28, 2008 8:06 am
by AbleMods
There is a correlation, so you are on the right track.
The confusion comes when you realize a product can be assigned to more than one category.
Then the table relationships get weird as you-know-what and you just decide it's better to let Able do the work for you.
If you think categories-to-products is tough, wait'll you see Variants, OptionChoices and Options. Took me a solid 20-30 hours to get the hang of those in code.
