Class VariantOptionService
- Namespace
- Dynamicweb.Ecommerce
- Assembly
- Dynamicweb.Ecommerce.dll
public class VariantOptionService : ICacheStorage<string, VariantOption>, ICacheStorage<string>, ICacheStorage
- Inheritance
-
VariantOptionService
- Implements
- Inherited Members
Methods
ClearCache()
Clears cached Variant Options.
public void ClearCache()
ClearCache(IEnumerable<string>)
Resets the specified keys to the default value for objects stored in the object cache
public void ClearCache(IEnumerable<string> keys)
Parameters
keys
IEnumerable<string>- Keys to reset
ClearCache(string)
Resets the specified key to the default value for objects stored in the object cache
public void ClearCache(string key)
Parameters
key
string- Key to reset
Delete(string)
Deletes instance with the specified parameters.
public void Delete(string id)
Parameters
id
string- The variant option id.
Delete(string, string)
Deletes instance with the specified parameters.
[Obsolete("Use Delete(String) instead")]
public void Delete(string id, string languageId)
Parameters
DeleteByVariantGroup(string)
public void DeleteByVariantGroup(string variantGroupId)
Parameters
variantGroupId
string
DeleteByVariantGroup(string, string)
Deletes instance with the specified parameters.
[Obsolete("Use DeleteByVariantGroup(String) instead")]
public void DeleteByVariantGroup(string variantGroupId, string languageId)
Parameters
DeleteVariantGroup(string)
Deletes instance with the specified parameters.
public void DeleteVariantGroup(string variantGroupId)
Parameters
variantGroupId
string
DeleteVariantOption(string)
Deletes instance with the specified parameters.
public void DeleteVariantOption(string id)
Parameters
id
string- The variant option ID.
DeleteVariantOption(string, string)
Deletes instance with the specified parameters.
[Obsolete("Use DeleteVariantOption(String) instead.")]
public void DeleteVariantOption(string id, string languageId)
Parameters
GetAll(bool)
Gets the variant options.
public IEnumerable<VariantOption> GetAll(bool isUnit)
Parameters
isUnit
bool- if set to
true
for units.
Returns
- IEnumerable<VariantOption>
- The collection of the VariantOption.
GetAll(bool, string)
Gets the variant options.
[Obsolete("Use GetAll(Boolean) instead")]
public IEnumerable<VariantOption> GetAll(bool isUnit, string languageId)
Parameters
Returns
- IEnumerable<VariantOption>
- The collection of the VariantOption.
GetAllByGroup(string)
Yields all options accross all languages, for a given variant group id.
public IList<VariantOption> GetAllByGroup(string variantGroupId)
Parameters
variantGroupId
string- Id
Returns
- IList<VariantOption>
- variantOptions
GetByGroup(string)
public IList<VariantOption> GetByGroup(string variantGroupId)
Parameters
variantGroupId
string
Returns
GetByGroupAndLanguage(string, string, bool)
Gets the variant options.
[Obsolete("Use GetByGroup(String) instead. Use VariantOption.Translations to get translated values.")]
public IList<VariantOption> GetByGroupAndLanguage(string languageId, string variantGroupId, bool showUntranslated = false)
Parameters
languageId
string- The language id.
variantGroupId
string- The variant group id.
showUntranslated
bool- Should show untranslated or not.
Returns
- IList<VariantOption>
- The options for the variant group.
GetByProduct(Product, int)
Gets the variant options.
[Obsolete("Use GetStockUnitsWithVariants(Product) or GetAll(Boolean) instead.")]
public IEnumerable<VariantOption> GetByProduct(Product product, int joinUnitMethod)
Parameters
Returns
- IEnumerable<VariantOption>
- The collection of the VariantOption.
GetByVariantId(string)
public IList<VariantOption> GetByVariantId(string variantId)
Parameters
variantId
string
Returns
GetByVariantId(string, string)
[Obsolete("Use GetByVariantId(String) instead")]
public IList<VariantOption> GetByVariantId(string variantId, string languageId)
Parameters
Returns
GetStockUnitsSorted(string, string)
public IEnumerable<VariantOption> GetStockUnitsSorted(string productId, string variantId)
Parameters
Returns
GetStockUnitsSorted(string, string, string)
[Obsolete("Use GetStockUnitsSorted(String, String) instead")]
public IEnumerable<VariantOption> GetStockUnitsSorted(string productId, string variantId, string languageId)
Parameters
Returns
GetStockUnitsWithVariants(Product)
public IEnumerable<VariantOption> GetStockUnitsWithVariants(Product product)
Parameters
product
Product
Returns
GetVariantOption(string)
Gets the variant option.
public VariantOption GetVariantOption(string id)
Parameters
id
string- The variant option id
Returns
- VariantOption
- The instance of the VariantOption.
GetVariantOption(string, string)
Gets the variant option.
[Obsolete("Use GetVariantOption(String) instead")]
public VariantOption GetVariantOption(string id, string languageId)
Parameters
Returns
- VariantOption
- The instance of the VariantOption.
GetVariantOption(string, string, bool)
Gets the variant option.
[Obsolete("Use GetVariantOption(String) instead")]
public VariantOption GetVariantOption(string id, string languageId, bool showUntranslated)
Parameters
id
string- The variant option id
languageId
string- The language id
showUntranslated
bool- Should show untranslated or not.
Returns
- VariantOption
- The instance of the VariantOption.
Save(VariantOption)
public void Save(VariantOption variantOption)
Parameters
variantOption
VariantOption