Try our conversational search powered by Generative AI!

Determine wheter a catalog node/product is original or link in catalog structure

Vote:
 

Hi!

Is there anyway to determine wheter a catalog node or product is original or link in the catalog structure?

Let us say that I drag a node to a different place in the structure. I then get a question to dublicate, move or link the node to the new place. Let's say I choose link.
Later I do parentNode.GetChildren() to get all the nodes and here I only what the node that are not linked in, only nodes where this is their original position.

Is there anyway I can do this?

Thanks!

/Kristoffer

#176892
Mar 29, 2017 12:30
Vote:
 

Each catalog content's ParentLink always refers to the home location. So if you do GetChildren for ContentReference x, the returned items which have ParentLink equal to X will be the items which have the category as home location. The linked items will have a different ParentLink.

#176896
Mar 29, 2017 13:32
Vote:
 

Perfect, thanks Magnus!

#176897
Mar 29, 2017 13:34
Vote:
 

Hi,

Currently there is no easy way to do this, the possible but not performant way is to load the children and check if their ParentLink is same as parentNode.ContentLink.

We are working on improving this in Commerce 11.

Regards,

#176898
Mar 29, 2017 13:35
Vote:
 

Quan, it would be great with a GetDescendants with an option "excludeLinkedItems" or something like that. Looking forward to 11!

#176899
Edited, Mar 29, 2017 13:38
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.