BV Commerce Forum
»
BV Commerce Support
»
Development
»
How to discover if a Product has Children
Rank: Member
Joined: 4/8/2008(UTC) Posts: 21
|
Hi. Seems like a simple question. I have a Product object and I want to see if it has Children (I assume Children means the same things as Variations, or Product choices). As far as I know, there is no bool on Product to determine this (Product.HasVariants must do something different as it always seems to be "false"). The best thing I've come up with is:
If Product.GlobalProduct.ParentId = String.Empty then
ProductCollection pc = InternalProduct.FindChildren(Product.Bvin)
end if
This seems inefficient however, as it will look up the children of any product that has no parent. It would be nice if there was a Product.Children collection. I tried looking into the ChoiceCombinations and ChoicesAndInputs collections but they always come up empty. What's the best way to do this?
thanks,
Marco
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.