Product has a Category record when it shouldn't

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
RichWendrock
Commander (CMDR)
Commander (CMDR)
Posts: 134
Joined: Sat Apr 05, 2008 12:55 am
Location: Austin Texas
Contact:

Product has a Category record when it shouldn't

Post by RichWendrock » Tue Feb 26, 2013 3:11 pm

Can you tell me why a product would have a category record when the category is not assigned to the product?

This may be a situation where the category was once assigned to the product and later removed but the category record lingers.
Regards,
Richard

http://www.TheHomePageStore.com

AbleCommerce
VERSION: 7.0.7.14588
MSSQL v2005
AC SCHEMA v2005
.NET CLR v2.0.50727.3634

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Product has a Category record when it shouldn't

Post by Katie » Tue Feb 26, 2013 8:30 pm

Hello Richard,

It's really hard to say. Perhaps you've used the Dataport utility, or maybe the installation was upgraded from an old version that had a bug. You can probably delete the record if you want. There is an Orphaned Items report under the Catalog menu. This should be able to locate any catalog objects that may need to be removed.

Thanks,
Katie
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

User avatar
RichWendrock
Commander (CMDR)
Commander (CMDR)
Posts: 134
Joined: Sat Apr 05, 2008 12:55 am
Location: Austin Texas
Contact:

Re: Product has a Category record when it shouldn't

Post by RichWendrock » Wed Feb 27, 2013 3:53 am

Thanks for your reply. I searched the documentation Wiki but could not find a section that explains what each value means for the ac_CatalogNodes.CatalogNodeTypeId. I finally found something in the forum that listed the CatalogNodeTypeId values (0 = category, 1 = product, 3 = link). The category record was causing the problem. Once I added ac_CatalogNodes.CatalogNodeTypeId=1 to my SQL, the problem is resolved. Where can I find documentation that explains how all records work in the database?

Concerning your suggestion that I check Orphan records. Thanks for that suggestion. There are no orphan records for Products, Categories or Links, but there are a lot of listings for images. The strange thing is, I see images listed that are assigned to products. I even double checked it, meaning I looked at the product and see the image assigned by the same name (.jpg). We use the Sku number for the photo name so there can be only one photo for that product. What constitutes an orphan photo?
Regards,
Richard

http://www.TheHomePageStore.com

AbleCommerce
VERSION: 7.0.7.14588
MSSQL v2005
AC SCHEMA v2005
.NET CLR v2.0.50727.3634

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Product has a Category record when it shouldn't

Post by mazhar » Thu Feb 28, 2013 8:51 am

There are four types of catalog objects Category, Product, Webpage and Link. Since they all can be part of a catalog and can be listed in category listings we need special handling. Thats where CatalogNodeType comes into play. We have a a special ac_CatalogNodeTable where each entry will corrospond to one of these four items in catalog.

ac_CatalogNodes
CategoryId => Parent Category Id to which a catalog item belongs
CatalogNodeId => This can hold a value corrosponding to Product.ProductId, Category.CategoryId, Webpage.WebpageId or Link.LinkId
CatalogNodeTypeId => This tells the type of catalog item Category = 0, Product = 1, Webpage = 2, Link = 3
OrderBy => Admin defined sort order of catalog objects which tells where to place items when listing them

Every catalog object must have an entry in ac_CatalogNodes table otherwise it will be considered orphan. Since this table is actully trying to deal with four different tables so we can't not enforce DBMS level integrity constraints. Integrity constraints are being imposed at API level to make sure we create/remove corrosponding catalog node entery when ever we create/remove catalog item.

Post Reply