Class VariantGroup
- Namespace
- Dynamicweb.Ecommerce.Variants
- Assembly
- Dynamicweb.Ecommerce.dll
A variant group that hold variant options
[Serializable]
public class VariantGroup : IEquatable<VariantGroup>
- Inheritance
-
VariantGroup
- Implements
- Inherited Members
Constructors
VariantGroup()
Initializes a new instance of the VariantGroup class.
public VariantGroup()
VariantGroup(IDataReader)
Initializes a new instance of the VariantGroup class.
[Obsolete("Use VariantGroupService instead.")]
public VariantGroup(IDataReader dataReader)
Parameters
dataReader
IDataReader- The data reader.
VariantGroup(string)
Initializes a new instance of the VariantGroup class.
[Obsolete("Use VariantGroupService instead.")]
public VariantGroup(string id)
Parameters
id
string- The id.
VariantGroup(string, Language)
Initializes a new instance of the VariantGroup class.
[Obsolete("Use VariantGroupService instead.")]
public VariantGroup(string id, Language language)
Parameters
Properties
Family
Gets or sets a value indicating whether this VariantGroup is family.
public bool Family { get; set; }
Property Value
- bool
true
if family, otherwise,false
.
Id
Gets or sets the id.
public string Id { get; set; }
Property Value
Label
Gets or sets the label.
[Obsolete("Use GetLabel and SetLabel instead.")]
public string Label { get; set; }
Property Value
LanguageId
Gets or sets the language id.
[Obsolete("Use Translations instead.")]
public string LanguageId { get; set; }
Property Value
Name
Gets or sets the name.
[Obsolete("Use GetName and SetName instead.")]
public string Name { get; set; }
Property Value
PriceDiffers
Gets or sets a value indicating whether to differentiate on price.
[Obsolete("Not in use")]
public bool PriceDiffers { get; set; }
Property Value
- bool
true
if price difference, otherwise,false
.
Properties
Gets or sets the variant group properties.
[Obsolete]
public IEnumerable<VariantGroupProperty> Properties { get; }
Property Value
Translations
Gets the translations
public TranslationCollection<VariantGroupTranslation> Translations { get; }
Property Value
Unit
Gets or sets a value indicating whether this VariantGroup is unit.
public bool Unit { get; set; }
Property Value
- bool
true
if unit; otherwise,false
.
VariantDisplayType
public VariantGroupDisplayType VariantDisplayType { get; set; }
Property Value
VariantGroupProductRelations
Gets or sets the variant product relations.
[Obsolete]
public IEnumerable<VariantGroupProductRelation> VariantGroupProductRelations { get; }
Property Value
VariantOptions
Gets or sets the variant options.
[Obsolete("Use GetAllVariantOptions instead")]
public IEnumerable<VariantOption> VariantOptions { get; }
Property Value
Methods
ClearVariantGroupsCache()
Clears the variant groups cache
[Obsolete("Use VariantGroupService instead.")]
public static void ClearVariantGroupsCache()
Clone()
Clones this instance.
[Obsolete("Dont use this.")]
public VariantGroup Clone()
Returns
- VariantGroup
- The new instance of the VariantGroup.
Copy()
Copies this instance.
[Obsolete("Dont use this.")]
public VariantGroup Copy()
Returns
- VariantGroup
- The new instance of the VariantGroup.
Create(string)
Creates the a variant group with the specified variant group id.
[Obsolete("Use VariantGroupService instead.")]
public static VariantGroup Create(string variantGroupId)
Parameters
variantGroupId
string- The variant group id.
Returns
- VariantGroup
- The VariantGroup.
Create(string, Language)
Creates the a variant group with the specified variant group ID and language ID.
[Obsolete("Use VariantGroupService instead.")]
public static VariantGroup Create(string variantGroupId, Language language)
Parameters
Returns
- VariantGroup
- The VariantGroup.
Delete()
Deletes this instance.
[Obsolete("Use VariantGroupService instead.")]
public void Delete()
Delete(VariantGroup, string, bool)
Deletes the specified variant group.
[Obsolete("Use VariantGroupService instead.")]
public void Delete(VariantGroup variantGroup, string languageId, bool deleteVariants)
Parameters
variantGroup
VariantGroup- The variant group.
languageId
string- The language id.
deleteVariants
bool- if set to
true
deletes variants.
Delete(string)
Deletes the variant group with the specified id.
[Obsolete("Use VariantGroupService instead.")]
public void Delete(string id)
Parameters
id
string- The id.
Delete(string, string)
Deletes the variant group with the specified ID and Language id.
[Obsolete("Use VariantGroupService.DeleteVariantGroup(String) instead.")]
public void Delete(string id, string languageId)
Parameters
Equals(VariantGroup)
public bool Equals(VariantGroup group)
Parameters
group
VariantGroup
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
obj
object
Returns
Fill(IDataReader)
Fills the object with data from the specified data reader.
[Obsolete("Use VariantGroupService instead.")]
public void Fill(IDataReader dataReader)
Parameters
dataReader
IDataReader- The data reader.
GetAllVariantGroups()
Gets all variant groups.
[Obsolete("Use VariantGroupService instead.")]
public static VariantGroupCollection GetAllVariantGroups()
Returns
GetAllVariantOptions()
Gets all variant options for this group.
public IList<VariantOption> GetAllVariantOptions()
Returns
- IList<VariantOption>
- variantOptions
GetGroupByOptionId(string)
Gets the variant groups by the given variant option id.
[Obsolete("Use VariantGroupService instead.")]
public static VariantGroup GetGroupByOptionId(string variantOptionId)
Parameters
variantOptionId
string- The variant option id
Returns
- VariantGroup
- The VariantGroup.
GetLabel(string)
Gets the label of the variant group for the given language.
public string GetLabel(string languageId)
Parameters
languageId
string- Language id
Returns
GetName(string)
Gets the name of the variant group for the given language.
public string GetName(string languageId)
Parameters
languageId
string- Language id
Returns
GetProperties()
Gets the properties of this group.
public IList<VariantGroupProperty> GetProperties()
Returns
- IList<VariantGroupProperty>
- properties
GetVariantGroupProductRelations()
Gets all product relations.
public IEnumerable<VariantGroupProductRelation> GetVariantGroupProductRelations()
Returns
- IEnumerable<VariantGroupProductRelation>
- productsRelations
GetVariantGroups(bool)
Gets the variant groups.
[Obsolete("Use VariantGroupService.GetUnits() to get all variant groups which are unit. Use VariantGroup.Translations to get translated values.")]
public static VariantGroupCollection GetVariantGroups(bool isUnit)
Parameters
isUnit
bool- The variant group is unit.
Returns
GetVariantGroups(string)
Gets the variant groups.
[Obsolete("Use VariantGroup.Translations to get translated values.")]
public static VariantGroupCollection GetVariantGroups(string groupId)
Parameters
groupId
string- The group ID.
Returns
GetVariantGroupsByLanguage()
Gets the variant groups by language.
[Obsolete("Use VariantGroupService.GetFilteredVariantGroups to get the list of groups without 'family' and 'unit' groups. Use VariantGroup.Translations to get translated values.")]
public static VariantGroupCollection GetVariantGroupsByLanguage()
Returns
GetVariantGroupsWithOptions(Product)
Gets the variant groups with options.
[Obsolete("Use VariantGroupService instead.")]
public static VariantGroupCollection GetVariantGroupsWithOptions(Product product)
Parameters
product
Product- The product.
Returns
GetVariantOptions(string)
Gets all existing variant options from this group, for the specified product.
public IList<VariantOption> GetVariantOptions(string productId)
Parameters
productId
string- Id of product
Returns
- IList<VariantOption>
- variantOptions
Save()
Saves this instance.
[Obsolete("Use VariantGroupService instead.")]
public void Save()
Save(string)
Saves the current instance with the specified id.
[Obsolete("Use VariantGroupService instead.")]
public void Save(string variantGroupId)
Parameters
variantGroupId
string- The ID.
SetLabel(string, string)
Sets the label of the variant group for the given language.
public void SetLabel(string languageId, string label)
Parameters
SetName(string, string)
Sets the name of the variant group for the given language.
public void SetName(string languageId, string name)