Class VariantOption
- Namespace
- Dynamicweb.Ecommerce.Variants
- Assembly
- Dynamicweb.Ecommerce.dll
A variant option in a variant group.
[Serializable]
public class VariantOption : IComparable<VariantOption>
- Inheritance
-
VariantOption
- Implements
- Inherited Members
Constructors
VariantOption()
Initializes a new instance of the VariantOption class.
public VariantOption()
VariantOption(IDataReader)
Initializes a new instance of the VariantOption class.
[Obsolete("Use VariantService instead.")]
public VariantOption(IDataReader dataReader)
Parameters
dataReader
IDataReader- The data reader.
VariantOption(string)
Initializes a new instance of the VariantOption class.
[Obsolete("Use VariantService instead.")]
public VariantOption(string id)
Parameters
id
string- The variant option id.
VariantOption(string, Language)
Initializes a new instance of the VariantOption class.
[Obsolete("Use VariantService instead.")]
public VariantOption(string id, Language language)
Parameters
Properties
Color
Gets or sets the color.
public string Color { get; set; }
Property Value
GroupId
Gets or sets the group id.
public string GroupId { get; set; }
Property Value
Icon
Gets or sets the icon.
public string Icon { get; set; }
Property Value
Id
Gets or sets the id.
public string Id { get; set; }
Property Value
LanguageId
Gets or sets the language id.
[Obsolete("Use Translations instead.")]
public string LanguageId { get; set; }
Property Value
LargeImage
Gets or sets the large image.
public string LargeImage { get; set; }
Property Value
MediumImage
Gets or sets the medium image.
public string MediumImage { get; set; }
Property Value
Name
Gets or sets the name.
[Obsolete("Use GetName and SetName instead.")]
public string Name { get; set; }
Property Value
SmallImage
Gets or sets the small image.
public string SmallImage { get; set; }
Property Value
SortOrder
Gets or sets the sort order.
public int SortOrder { get; set; }
Property Value
Translations
Gets the translations
public TranslationCollection<VariantOptionTranslation> Translations { get; }
Property Value
Methods
ClearVariantOptionCaches()
Clears the variant options cache
[Obsolete("Use VariantOptionService instead.")]
public static void ClearVariantOptionCaches()
Clone()
Clones this instance.
public VariantOption Clone()
Returns
- VariantOption
- The instance of the VariantOption.
CompareTo(VariantOption)
public int CompareTo(VariantOption other)
Parameters
other
VariantOption
Returns
Copy()
Copies this instance.
[Obsolete("Should not be used.", true)]
public VariantOption Copy()
Returns
- VariantOption
- The instance of the VariantOption.
Create(string)
Creates the specified variant option with the specified id.
[Obsolete("Use VariantOptionService instead.")]
public static VariantOption Create(string variantOptionId)
Parameters
variantOptionId
string- The variant option id.
Returns
- VariantOption
- The instance of the VariantOption.
Create(string, Language)
Creates a variant option based on the id and language.
[Obsolete("Use VariantOptionService instead.")]
public static VariantOption Create(string variantOptionId, Language language)
Parameters
Returns
- VariantOption
- The instance of the VariantOption.
Delete()
Deletes this instance.
[Obsolete("Use VariantOptionService.DeleteVariantOption(String) instead.")]
public void Delete()
Delete(VariantGroup)
Deletes instance with the specified parameters.
[Obsolete("Use VariantOptionService instead.")]
public static void Delete(VariantGroup variantGroup)
Parameters
variantGroup
VariantGroup- The instance of VariantGroup.
Delete(VariantGroup, string)
Deletes instance with the specified parameters.
[Obsolete("Use VariantOptionService.DeleteByVariantGroup(String) instead.")]
public static void Delete(VariantGroup variantGroup, string languageId)
Parameters
variantGroup
VariantGroup- The instance of VariantGroup.
languageId
string- The language id.
Delete(string)
Deletes instance with the specified parameters.
[Obsolete("Use VariantOptionService.DeleteVariantOption(String) instead.")]
public static void Delete(string id)
Parameters
id
string- The variant option id.
Delete(string, string)
Deletes instance with the specified parameters.
[Obsolete("Use VariantOptionService.DeleteVariantOption(String) instead.")]
public static void Delete(string id, string languageId)
Parameters
DeleteProductUnitRelations()
Deletes relations to the product unit
[Obsolete("Use VariantOptionService.DeleteProductUnitRelations instead.")]
public void DeleteProductUnitRelations()
DeleteVariantOption(string)
Deletes the variant option with variant products
[Obsolete("Use VariantOptionService.DeleteVariantOption(String) instead.")]
public static void DeleteVariantOption(string id)
Parameters
id
string- The variant id.
Equals(object)
public override bool Equals(object obj)
Parameters
obj
object
Returns
Fill(IDataReader)
Initializes properties with new data.
[Obsolete("Use VariantService instead.")]
public void Fill(IDataReader dataReader)
Parameters
dataReader
IDataReader- The data reader.
GetAllVariantOptions()
Gets the variant options.
[Obsolete("Use VariantOptionService instead.")]
public static IEnumerable<VariantOption> GetAllVariantOptions()
Returns
- IEnumerable<VariantOption>
- The collection of the VariantOption.
GetName(string)
Gets the name of the variant option for the given language.
public string GetName(string languageId)
Parameters
languageId
string- Language id
Returns
GetPropertyValue(string, string)
Gets property value for the given language
public string GetPropertyValue(string languageId, string propertyId)
Parameters
Returns
GetVariantOption(string)
Gets the variant option.
[Obsolete("Use VariantOptionService.GetVariantOption(String) instead.")]
public static VariantOption GetVariantOption(string variantOptionId)
Parameters
variantOptionId
string- The variant option id
Returns
- VariantOption
- The instance of the VariantOption.
GetVariantOptions(CommandBuilder)
Gets the variant options.
[Obsolete("Use VariantOptionService instead.")]
public static IEnumerable<VariantOption> GetVariantOptions(CommandBuilder commandBuilder)
Parameters
commandBuilder
CommandBuilder- The command builder
Returns
- IEnumerable<VariantOption>
- The collection of the VariantOption.
GetVariantOptions(Price)
Gets the variant options.
[Obsolete]
public static IEnumerable<VariantOption> GetVariantOptions(Price price)
Parameters
price
Price- The price.
Returns
- IEnumerable<VariantOption>
- The collection of the VariantOption.
GetVariantOptions(Product, int)
Gets the variant options.
[Obsolete("Use VariantOptionService.GetStockUnitsWithVariants(Product) or VariantOptionService.GetAll(Boolean) instead.")]
public static IEnumerable<VariantOption> GetVariantOptions(Product product, int joinUnitMethod)
Parameters
Returns
- IEnumerable<VariantOption>
- The collection of the VariantOption.
GetVariantOptions(VariantGroup)
Gets the variant options.
[Obsolete("Use VariantOptionService.GetByGroup instead.")]
public static IEnumerable<VariantOption> GetVariantOptions(VariantGroup variantGroup)
Parameters
variantGroup
VariantGroup- The variant group.
Returns
- IEnumerable<VariantOption>
- The options for the variant group.
Remarks
Is dependent on the setting "Only show translated elements" of the language settings.
GetVariantOptions(bool)
Gets the variant options.
[Obsolete("Use VariantOptionService.GetAll(Bool) instead.")]
public static IEnumerable<VariantOption> GetVariantOptions(bool isUnit)
Parameters
isUnit
bool- if set to
true
for units.
Returns
- IEnumerable<VariantOption>
- The collection of the VariantOption.
GetVariantOptions(string)
Gets the variant options.
[Obsolete("Use VariantOptionService.GetByGroup(String) instead.")]
public static IEnumerable<VariantOption> GetVariantOptions(string variantGroupId)
Parameters
variantGroupId
string- The variant group id.
Returns
- IEnumerable<VariantOption>
- The collection of the VariantOption.
Remarks
It selects only translated elements.
Save()
Saves this instance.
[Obsolete("Use VariantOptionService instead.")]
public void Save()
Save(string)
Saves this instance to instance with the specified id.
[Obsolete("Use VariantOptionService.Save(VariantOption) instead.")]
public void Save(string id)
Parameters
id
string- The variant option id.
SetName(string, string)
Sets the name of the variant option for the given language.
public void SetName(string languageId, string name)