Add Categories direct to database using t-sql

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
svetalex
Ensign (ENS)
Ensign (ENS)
Posts: 15
Joined: Fri Feb 22, 2008 1:37 pm

Add Categories direct to database using t-sql

Post by svetalex » Wed Feb 27, 2008 2:43 pm

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?

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Post by AbleMods » Wed Feb 27, 2008 6:27 pm

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.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
svetalex
Ensign (ENS)
Ensign (ENS)
Posts: 15
Joined: Fri Feb 22, 2008 1:37 pm

ac_CatalogNodes table - ??

Post by svetalex » Thu Feb 28, 2008 7:40 am

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.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Post by AbleMods » Thu Feb 28, 2008 8:06 am

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. :(
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

Post Reply