Page 1 of 1
Product has a Category record when it shouldn't
Posted: Tue Feb 26, 2013 3:11 pm
by RichWendrock
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.
Re: Product has a Category record when it shouldn't
Posted: Tue Feb 26, 2013 8:30 pm
by Katie
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
Re: Product has a Category record when it shouldn't
Posted: Wed Feb 27, 2013 3:53 am
by RichWendrock
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?
Re: Product has a Category record when it shouldn't
Posted: Thu Feb 28, 2013 8:51 am
by mazhar
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.