Class VariantCombination
- Namespace
- Dynamicweb.Ecommerce.Variants
- Assembly
- Dynamicweb.Ecommerce.dll
A combination of variant options on a product
[Serializable]
public class VariantCombination : IComparable<VariantCombination>
- Inheritance
-
VariantCombination
- Implements
- Inherited Members
Constructors
VariantCombination()
Initializes a new instance of the VariantCombination class.
public VariantCombination()
VariantCombination(IDataReader)
Initializes a new instance of the VariantCombination class.
[Obsolete("Use VariantCombinationService instead.")]
public VariantCombination(IDataReader dataReader)
Parameters
dataReader
IDataReader- The data reader.
VariantCombination(string)
Initializes a new instance of the VariantCombination class.
[Obsolete("Use VariantCombinationService instead.")]
public VariantCombination(string productId)
Parameters
productId
string- The product ID.
VariantCombination(string, string)
Initializes a new instance of the VariantCombination class.
[Obsolete("Use VariantCombinationService instead.")]
public VariantCombination(string productId, string variantId)
Parameters
Fields
CombinationTextSeparator
public const string CombinationTextSeparator = " - "
Field Value
Properties
HasRowInProductTable
Indicates if the given variantcombination has an extended product or is simple (eg. if it has a productrow in the database table).
public bool HasRowInProductTable { get; }
Property Value
- bool
- hasRowInProductTable
Product
[Obsolete]
public Product Product { get; }
Property Value
ProductId
Gets or sets the product ID.
public string ProductId { get; set; }
Property Value
SimpleVariant
Gets or sets the product.
[Obsolete("Use HasRowInProductTable instead.")]
public bool SimpleVariant { get; set; }
Property Value
VariantId
Gets or sets the variant ID.
public string VariantId { get; set; }
Property Value
VariantOptions
Gets or sets the variant options.
[Obsolete("Dont use this.")]
public IEnumerable<VariantOption> VariantOptions { get; set; }
Property Value
VariantText
Gets or sets the variant text.
[Obsolete]
public string VariantText { get; set; }
Property Value
Methods
ClearVariantCombinationCache()
Clears the variant combination caches
[Obsolete("Use VariantCombinationService instead.")]
public static void ClearVariantCombinationCache()
CompareTo(VariantCombination)
Compares one VariantCombination with another.
public int CompareTo(VariantCombination other)
Parameters
other
VariantCombination- An object to compare with this instance.
Returns
- int
- variantCombiantionComparison
Delete()
Deletes this instance.
[Obsolete("Use VariantCombinationService instead.")]
public void Delete()
Delete(ProductCollection)
Deletes the combinations for the specified products.
[Obsolete("Use VariantCombinationService instead.")]
public static CommandBuilder Delete(ProductCollection products)
Parameters
products
ProductCollection- The products.
Returns
Delete(ProductCollection, bool)
Deletes the combinations for the specified products.
[Obsolete("Use VariantCombinationService instead.")]
public static CommandBuilder Delete(ProductCollection products, bool execute)
Parameters
products
ProductCollection- The products.
execute
bool- if set to
true
it executes, otherwise not...
Returns
Delete(VariantGroup)
Deletes the combinations for the specified variant group.
[Obsolete("Use VariantCombinationService instead.")]
public static void Delete(VariantGroup variantGroup)
Parameters
variantGroup
VariantGroup- The variant group.
Delete(string)
Deletes the combinations for the specified product ID.
[Obsolete("Use VariantCombinationService instead.")]
public static void Delete(string productId)
Parameters
productId
string- The product ID.
Delete(string, string)
Deletes the combinations for the specified product and variant ID.
[Obsolete("Use VariantCombinationService instead.")]
public static void Delete(string productId, string variantId)
Parameters
Fill(IDataReader)
Fills the instance with data from the specified data reader.
[Obsolete("Use VariantCombinationService instead.")]
public void Fill(IDataReader dataReader)
Parameters
dataReader
IDataReader- The data reader.
GetCombinationText(Product, string, string)
Get the combination texts.
[Obsolete("Use VariantCombinationService instead.")]
public static string GetCombinationText(Product product, string variantId, string variantTextSeperator)
Parameters
product
Product- The product.
variantId
stringvariantTextSeperator
string- The variant text seperator.
Returns
- string
- The combination text.
GetProduct()
Gets a variant product from a random language.
[Obsolete("Use GetProduct with languageId instead. Eg. GetProduct(Common.Context.LanguageID).")]
public Product GetProduct()
Returns
Remarks
Random: Language is dependent upon ALL the configuration of everything in the whole stack. Dont use this!
GetProduct(string)
Gets the product.
public Product GetProduct(string languageId)
Parameters
languageId
string
Returns
GetProductCombinations(Product)
Gets the product combinations.
[Obsolete("Use VariantCombinationService instead.")]
public static VariantCombinationCollection GetProductCombinations(Product product)
Parameters
product
Product- The product.
Returns
GetProductCombinations(Product, string)
Gets the product combinations.
[Obsolete("Use VariantCombinationService instead.")]
public static VariantCombinationCollection GetProductCombinations(Product product, string variantTextSeperator)
Parameters
Returns
GetProductCombinations(Product, string, bool)
Gets the product combinations.
[Obsolete("Use VariantCombinationService instead.")]
public static VariantCombinationCollection GetProductCombinations(Product product, string variantTextSeperator, bool isFrontend)
Parameters
product
Product- The product.
variantTextSeperator
string- Is always ignored. Makes no sense in a cached environment...
isFrontend
bool- if set to
true
it is front end.
Returns
GetVariantName(string)
Gets the variant text.
public string GetVariantName(string languageId)
Parameters
languageId
string
Returns
GetVariantOptionIds()
Gets the option ids of this variant.
public string[] GetVariantOptionIds()
Returns
- string[]
- optionIds
Save(string, string)
Saves the current instance with the specified parameters.
[Obsolete("Use VariantCombinationService instead.")]
public void Save(string productId, string variantId)