Class CombineProductsData
- Namespace
- Dynamicweb.Ecommerce.Variants
- Assembly
- Dynamicweb.Ecommerce.dll
Describes a set of products that are to be combined into one master product with variants, and the variant options each of them ends up on. Used as the input to BuildFamily(string, IEnumerable<string>, string, bool) and BuildFamilyAsVariants(string, List<ProductInfo>, List<string>).
public class CombineProductsData
- Inheritance
-
CombineProductsData
- Inherited Members
Properties
CanChangeMasterProduct
Gets or sets a value indicating whether the master product itself may be turned into a variant, which also clears its product number and EAN.
public bool CanChangeMasterProduct { get; set; }
Property Value
FilteredProductVariants
Gets or sets the display names of the products that were left out of the combine because they already have variants of their own. Populated by Load(string, IEnumerable<string>, string, CombineProductsMode, string) so a caller can report them.
public List<string> FilteredProductVariants { get; set; }
Property Value
GroupId
Gets or sets the ID of the product group the combine was started from, if any.
public string GroupId { get; set; }
Property Value
LanguageId
Gets or sets the ID of the language the combine is performed in. Defaults to the default language when left empty.
public string LanguageId { get; set; }
Property Value
MasterProductId
Gets or sets the ID of the product that the other products become variants of.
public string MasterProductId { get; set; }
Property Value
Mode
Gets or sets the kind of structure the combine produces. Defaults to Variants.
public CombineProductsData.CombineProductsMode Mode { get; set; }
Property Value
Products
Gets or sets the products taking part in the combine, including the master product itself.
public IEnumerable<CombineProductsData.ProductInfo> Products { get; set; }
Property Value
VariantGroupsIds
Gets or sets the IDs of the variant groups the combined products are placed in.
public IEnumerable<string> VariantGroupsIds { get; set; }
Property Value
Methods
Load(string, IEnumerable<string>, string, CombineProductsMode, string)
Builds a CombineProductsData from the given parameters.
public static CombineProductsData Load(string masterId, IEnumerable<string> productsIds, string languageId, CombineProductsData.CombineProductsMode mode, string jsonData)
Parameters
masterIdstringThe ID of the product the others are combined onto. May be empty when only
productsIdsis given.productsIdsIEnumerable<string>The IDs of the products to combine onto the master product.
languageIdstringThe ID of the language to read the products in. The default language is used when empty.
modeCombineProductsData.CombineProductsModeThe kind of structure the combine produces.
jsonDatastringA previously serialized CombineProductsData. Takes precedence over the other parameters when it can be deserialized.
Returns
- CombineProductsData
The combine data to hand to VariantService.
Remarks
jsonData is deserialized first; only if that is absent or fails is the product family
info looked up from masterId and languageId. Products that already
have variants are skipped and listed in FilteredProductVariants.