I've had to take some objects like webpages and add them to an array list after turning them into catalog nodes. How can I get the category id of the parent category? I've seen it in other places like product.
Thanks
CatalogNode Parent Category ID
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
CatalogNode Parent Category ID
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: CatalogNode Parent Category ID
Try
Code: Select all
catalogNode.CategoryId
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: CatalogNode Parent Category ID
That wasn't coming up in intellisense so I hadn'tused and now it breaks the page.
I'm creating the node from an object that has an id and a type so that I can get a link to it.
CatalogNode node = new CatalogNode(0, objectId2, (byte)objectType2);
The above line is what I have to go on. I can't add the CategoryId in place of the 0 because the custom object doesn't know the category Id.
So I added the following, but it still shows 0 for the category Id
int CID = node.CategoryId;
newNode = new CatalogNode(CID, objectId2, (byte)objectType2);
If I hard-code a number in for the CID, then it picks up that number.
I'm still not able to get the category id. I need something like Lookup the object that has a CatalogNodeId of xx and a type of yy and find the category id for one instance of that node.
Maybe I need to approach this a different way, but I don't know how.
I am just trying to get a category id into the link so that there won't be duplicate content in search engines-- the link works fine with a 0 for the category id.
Thanks
I'm creating the node from an object that has an id and a type so that I can get a link to it.
CatalogNode node = new CatalogNode(0, objectId2, (byte)objectType2);
The above line is what I have to go on. I can't add the CategoryId in place of the 0 because the custom object doesn't know the category Id.
So I added the following, but it still shows 0 for the category Id
int CID = node.CategoryId;
newNode = new CatalogNode(CID, objectId2, (byte)objectType2);
If I hard-code a number in for the CID, then it picks up that number.
I'm still not able to get the category id. I need something like Lookup the object that has a CatalogNodeId of xx and a type of yy and find the category id for one instance of that node.
Maybe I need to approach this a different way, but I don't know how.
I am just trying to get a category id into the link so that there won't be duplicate content in search engines-- the link works fine with a 0 for the category id.
Thanks
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: CatalogNode Parent Category ID
I think for this you need to query the ac_CatalogNodes table to find out the parent category id. For example
You can create another property which returns the parent category ids and when you call that property first it query the ac_CatalogNodes table using above query with the current node id and type of your object.
Code: Select all
SELECT CategoryId FROM ac_CatalogNodes WHERE CatalogNodeId = nodeId AND CatalogNodeType = nodeType
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: CatalogNode Parent Category ID
I ended up cloning the GetCategoryId(int nodeId, CatalogNodeType nodeType) from the Able source code and it works well.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx