Class VariantGroupService
- Namespace
- Dynamicweb.Ecommerce.Variants
- Assembly
- Dynamicweb.Ecommerce.dll
public class VariantGroupService : ICacheStorage<string, VariantGroup>, ICacheStorage<string>, ICacheStorage
- Inheritance
-
VariantGroupService
- Implements
- Inherited Members
Methods
ClearCache()
Clears the variant groups cache
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
keysIEnumerable<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
keystringKey to reset
ClearOptionValues()
Clears variant group property values cache.
public void ClearOptionValues()
ClearVariantGroupProductRelationCache()
Clears the variant groups cache
public void ClearVariantGroupProductRelationCache()
ClearVariantGroupPropertiesCache()
Clears variant group properties cache.
public void ClearVariantGroupPropertiesCache()
CreateProductRelation(string, string)
public void CreateProductRelation(string productId, string variantGroupId)
Parameters
Delete(VariantGroup)
Deletes the variant group with the specified id.
public void Delete(VariantGroup variantGroup)
Parameters
variantGroupVariantGroup
DeleteOptionValues(string)
Delete variant group property values for variant option
public void DeleteOptionValues(string optionId)
Parameters
optionIdstring
DeleteOptionValues(string, string)
Delete variant group property values for variant option and language
public void DeleteOptionValues(string optionId, string languageId)
Parameters
DeleteProductRelation(string, string, string)
Deletes instances with the specified parameters.
public void DeleteProductRelation(string productId, string groupId = "", string relationId = "")
Parameters
DeleteProductRelations(IEnumerable<Product>)
Deletes instances with the specified parameters.
public void DeleteProductRelations(IEnumerable<Product> products)
Parameters
productsIEnumerable<Product>The IEnumerable<T>.
DeleteVariantGroup(string)
Deletes the variant group with the specified id.
public void DeleteVariantGroup(string variantGroupId)
Parameters
variantGroupIdstring
DeleteVariantGroupProperty(VariantGroupProperty)
Deletes instance with the specified parameters.
public void DeleteVariantGroupProperty(VariantGroupProperty variantGroupProperty)
Parameters
variantGroupPropertyVariantGroupPropertyThe variant group property.
DeleteVariantGroupProperty(string)
Deletes instance with the specified parameters.
public void DeleteVariantGroupProperty(string id)
Parameters
idstringThe variant group property id.
DeleteVariantGroupPropertyByGroupId(string)
Deletes instance with the specified parameters.
public void DeleteVariantGroupPropertyByGroupId(string variantGroupId)
Parameters
variantGroupIdstring
GetAllVariantGroups()
Gets all variant groups.
public IList<VariantGroup> GetAllVariantGroups()
Returns
- IList<VariantGroup>
The IList<T>.
Remarks
Result variant group list includes 'family' variant groups
GetFamilyVariantGroups()
Gets all variant groups which are 'family'.
public IList<VariantGroup> GetFamilyVariantGroups()
Returns
- IList<VariantGroup>
The IList<T>.
Remarks
Result 'family' variant group list
GetFilteredVariantGroups()
Gets the variant groups list in which 'family' groups are excluded.
public IList<VariantGroup> GetFilteredVariantGroups()
Returns
- IList<VariantGroup>
The list of variant groups.
Remarks
Result variant group list includes variant groups e.g. 'family' variant groups excluded from results
GetProductRelations(VariantGroup)
Gets the relations.
public IEnumerable<VariantGroupProductRelation> GetProductRelations(VariantGroup variantGroup)
Parameters
variantGroupVariantGroupThe VariantGroup.
Returns
- IEnumerable<VariantGroupProductRelation>
The collection of the VariantGroupProductRelation.
GetProductRelations(VariantGroup, string)
Gets the relations.
public IEnumerable<VariantGroupProductRelation> GetProductRelations(VariantGroup variantGroup, string productId)
Parameters
variantGroupVariantGroupThe VariantGroup.
productIdstringThe product id.
Returns
- IEnumerable<VariantGroupProductRelation>
The collection of the VariantGroupProductRelation.
GetProductRelations(string)
Gets the relations.
public IEnumerable<VariantGroupProductRelation> GetProductRelations(string productId)
Parameters
productIdstringThe product id.
Returns
- IEnumerable<VariantGroupProductRelation>
The collection of the VariantGroupProductRelation.
GetVariantGroup(string)
public VariantGroup? GetVariantGroup(string variantGroupId)
Parameters
variantGroupIdstring
Returns
GetVariantGroupOptionPropertyValue(string, string, string, bool)
Gets variant group property value from the option
public string GetVariantGroupOptionPropertyValue(string optionId, string propertyId, string languageId, bool showUntranslated = false)
Parameters
optionIdstringThe option id.
propertyIdstringThe property id.
languageIdstringThe language id.
showUntranslatedboolShould show untranslated or not.
Returns
- string
The variant group property value
GetVariantGroupProperties()
Gets the variant group properties
public IEnumerable<VariantGroupProperty> GetVariantGroupProperties()
Returns
- IEnumerable<VariantGroupProperty>
variantGroupProperties
GetVariantGroupProperty(string)
Gets the variant group properties for the specified group.
public IList<VariantGroupProperty> GetVariantGroupProperty(string groupId)
Parameters
groupIdstringGroup id
Returns
- IList<VariantGroupProperty>
variantGroupProperties
GetVariantGroupsByProductId(string)
Gets the variant groups with options.
public IList<VariantGroup> GetVariantGroupsByProductId(string productId)
Parameters
productIdstringThe product id.
Returns
- IList<VariantGroup>
The IList<T>.
Save(VariantGroup)
Saves the current instance with the specified id.
public void Save(VariantGroup variantGroup)
Parameters
variantGroupVariantGroup
Save(VariantGroupProductRelation)
public void Save(VariantGroupProductRelation relation)
Parameters
relationVariantGroupProductRelation
Save(VariantGroupProperty)
Saves group property
public void Save(VariantGroupProperty variantGroupProperty)
Parameters
variantGroupPropertyVariantGroupPropertyThe variant group property.
SaveValue(string, string, string, string)
Saves group property value
public void SaveValue(string optionId, string propertyId, string languageId, string propertyValue)
Parameters
optionIdstringThe option id
propertyIdstringThe property id
languageIdstringThe language id
propertyValuestringThe property value
VariantGroupCounter(string)
Gets the product relations count.
public int VariantGroupCounter(string productId)
Parameters
productIdstringThe product.
Returns
- int
Count of the relations.