Posted on 13/03/2026 10:52:14
Hi Kim,
I'm not sure what you mean when you say "as a query expression".
This is the way the type is determinted internally based on the Product.Type
switch (product.Type)
{
case ProductType.Stock:
{
if (!string.IsNullOrWhiteSpace(product.VariantId))
{
pm.Kind = ProductDataModelKind.Variant;
return;
}
var hasVariantGroups = Services.VariantGroups.GetProductRelations(product.Id).Any();
if (hasVariantGroups)
{
pm.Kind = ProductDataModelKind.Master;
return;
}
pm.Kind = ProductDataModelKind.StandAlone;
break;
}
case ProductType.Service:
pm.Kind = ProductDataModelKind.Service;
break;
case ProductType.Bom:
pm.Kind = ProductDataModelKind.Bundle;
break;
case ProductType.GiftCard:
pm.Kind = ProductDataModelKind.GiftCard;
break;
}