Class VariantService
- Namespace
- Dynamicweb.Ecommerce.Variants
- Assembly
- Dynamicweb.Ecommerce.dll
public class VariantService
- Inheritance
-
VariantService
- Inherited Members
Methods
AddGroupToProduct(string, string)
Adds a product relation to the specified variant group.
public void AddGroupToProduct(string productId, string variantGroupId)
Parameters
Remarks
Deletes all variants for product
BuildFamily(string, IEnumerable<string>, string)
public void BuildFamily(string masterProductId, IEnumerable<string> productIds, string languageId)
Parameters
masterProductId
stringproductIds
IEnumerable<string>languageId
string
ClearCache()
Clears all caches used by everything related to variants
public void ClearCache()
ClearVariantCombinationCache()
Clears the variant combination cache.
public void ClearVariantCombinationCache()
ClearVariantGroupCache()
Clears the cache for variant groups
public void ClearVariantGroupCache()
ClearVariantGroupOptionValuesCache()
Clears the variant group option values
public void ClearVariantGroupOptionValuesCache()
ClearVariantGroupProductRelationCache()
Clears the variant group product relations
public void ClearVariantGroupProductRelationCache()
ClearVariantGroupPropertiesCache()
Clears the cache for variant group properties
public void ClearVariantGroupPropertiesCache()
ClearVariantOptionsCache()
Clears the cache for variantoptions
public void ClearVariantOptionsCache()
CreateExtendedVariant(Product, IEnumerable<string>)
Creates a variant for the product.
public void CreateExtendedVariant(Product product, IEnumerable<string> optionIds)
Parameters
product
Product- Product
optionIds
IEnumerable<string>- Ids of variant options
CreateSimpleVariant(string, IEnumerable<string>)
Creates a variant for the product.
public void CreateSimpleVariant(string productId, IEnumerable<string> optionIds)
Parameters
productId
string- Id of product
optionIds
IEnumerable<string>- Ids of variant options
Delete(VariantGroup)
Deletes the specifed variant group and the options used by this group.
public void Delete(VariantGroup group)
Parameters
group
VariantGroup- Variantgroup
Delete(VariantOption)
public void Delete(VariantOption variantOption)
Parameters
variantOption
VariantOption
DeleteAllVariantOptionLanguages(string)
[Obsolete("Use DeleteVariantOption(String) instead")]
public void DeleteAllVariantOptionLanguages(string variantOptionId)
Parameters
variantOptionId
string
DeleteAllVariantOptionLanguages(string, string)
[Obsolete("Use DeleteVariantOption(String) instead")]
public void DeleteAllVariantOptionLanguages(string variantOptionId, string languageId)
Parameters
DeleteAllVariants(string)
Deletes all variants of product.
public void DeleteAllVariants(string productId)
Parameters
productId
string- Id of product
DeleteVariant(string, string)
Deletes a specific variant of a product.
public void DeleteVariant(string productId, string variantId)
Parameters
DeleteVariantGroup(string)
Deletes the specifed variant group and the options used by this group.
public void DeleteVariantGroup(string variantGroupId)
Parameters
variantGroupId
string- Id of variant group
DeleteVariantGroup(string, string)
Deletes the specifed variant group and the options used by this group.
[Obsolete("Use DeleteVariantGroup(String) instead")]
public void DeleteVariantGroup(string variantGroupId, string languageId)
Parameters
DeleteVariantOption(string)
public void DeleteVariantOption(string variantOptionId)
Parameters
variantOptionId
string
DeleteVariantOption(string, string)
[Obsolete("Use DeleteVariantOption(String) instead")]
public void DeleteVariantOption(string variantOptionId, string languageId)
Parameters
ExtendAllVariants(Product)
Creates extended variants for all simple variant combinations of the product.
public void ExtendAllVariants(Product product)
Parameters
product
Product- The product
GetOptions(string, VariantGroup)
Gets the variant options matching the parameters.
public IList<VariantOption> GetOptions(string productId, VariantGroup variantGroup)
Parameters
productId
string- Id of product
variantGroup
VariantGroup- VariantGroup
Returns
- IList<VariantOption>
- variantOptions
GetOptions(string, string)
Gets the variant options matching the parameters.
public IList<VariantOption> GetOptions(string productId, string variantGroupId)
Parameters
Returns
- IList<VariantOption>
- variantOptions
GetOptions(string, string, string)
Gets the variant options matching the parameters.
[Obsolete("Use GetOptions(String, String) instead")]
public IList<VariantOption> GetOptions(string productId, string variantGroupId, string languageId)
Parameters
productId
string- Id of product
variantGroupId
string- Id of variantgroup
languageId
string- Id of language
Returns
- IList<VariantOption>
- variantOptions
GetUnitName(string, string)
Gets the unit name.
public string GetUnitName(string unitId, string languageId)
Parameters
Returns
- string
- unitName
GetVariantGroup(string)
Gets variant group.
public VariantGroup GetVariantGroup(string variantGroupId)
Parameters
variantGroupId
string- Id of variant group
Returns
- VariantGroup
- variantGroup
GetVariantGroup(string, string)
Gets variant group.
[Obsolete("Use GetVariantGroup(String) instead")]
public VariantGroup GetVariantGroup(string variantGroupId, string languageId)
Parameters
Returns
- VariantGroup
- variantGroup
GetVariantName(string, string)
Gets the variant name.
public string GetVariantName(string variantId, string languageId = null)
Parameters
Returns
- string
- variantName
PotentialVariantCount(string)
Yields a count of all possible variants.
public ulong? PotentialVariantCount(string productId)
Parameters
productId
string- Product id
Returns
- ulong?
- numberOfPotentialVariants
Remarks
If count exceeds 10000000, return nothing
PotentialVariantCount(string, string, bool)
Yields a count of all possible variants.
[Obsolete("Use PotentialVariantCount(String) instead")]
public ulong? PotentialVariantCount(string productId, string languageId, bool includeUntranslated)
Parameters
Returns
- ulong?
- numberOfPotentialVariants
Remarks
If count exceeds 10000000, return nothing
RemoveAllGroupsFromProduct(string)
Removes all variant groups from specied product, for all languages.
public void RemoveAllGroupsFromProduct(string productId)
Parameters
productId
string- Id of product
Remarks
Deletes all variants for product
RemoveGroupFromProduct(string, string)
Removes all variant groups from specied product and language.
public void RemoveGroupFromProduct(string productId, string variantGroupId)
Parameters
Remarks
Deletes all variants for product
Save(VariantCombination)
Saves the variant.
public void Save(VariantCombination variantCombination)
Parameters
variantCombination
VariantCombination- Variant
Save(VariantGroup)
Saves the variant group.
public void Save(VariantGroup group)
Parameters
group
VariantGroup- VariantGroup
Save(VariantOption)
public void Save(VariantOption variantOption)
Parameters
variantOption
VariantOption