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
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
stringKey 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
variantGroup
VariantGroup
DeleteOptionValues(string)
Delete variant group property values for variant option
public void DeleteOptionValues(string optionId)
Parameters
optionId
string
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
products
IEnumerable<Product>The IEnumerable<T>.
DeleteVariantGroup(string)
Deletes the variant group with the specified id.
public void DeleteVariantGroup(string variantGroupId)
Parameters
variantGroupId
string
DeleteVariantGroupProperty(VariantGroupProperty)
Deletes instance with the specified parameters.
public void DeleteVariantGroupProperty(VariantGroupProperty variantGroupProperty)
Parameters
variantGroupProperty
VariantGroupPropertyThe variant group property.
DeleteVariantGroupProperty(string)
Deletes instance with the specified parameters.
public void DeleteVariantGroupProperty(string id)
Parameters
id
stringThe variant group property id.
DeleteVariantGroupPropertyByGroupId(string)
Deletes instance with the specified parameters.
public void DeleteVariantGroupPropertyByGroupId(string variantGroupId)
Parameters
variantGroupId
string
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
variantGroup
VariantGroupThe VariantGroup.
Returns
- IEnumerable<VariantGroupProductRelation>
The collection of the VariantGroupProductRelation.
GetProductRelations(VariantGroup, string)
Gets the relations.
public IEnumerable<VariantGroupProductRelation> GetProductRelations(VariantGroup variantGroup, string productId)
Parameters
variantGroup
VariantGroupThe VariantGroup.
productId
stringThe product id.
Returns
- IEnumerable<VariantGroupProductRelation>
The collection of the VariantGroupProductRelation.
GetProductRelations(string)
Gets the relations.
public IEnumerable<VariantGroupProductRelation> GetProductRelations(string productId)
Parameters
productId
stringThe product id.
Returns
- IEnumerable<VariantGroupProductRelation>
The collection of the VariantGroupProductRelation.
GetVariantGroup(string)
public VariantGroup GetVariantGroup(string variantGroupId)
Parameters
variantGroupId
string
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
optionId
stringThe option id.
propertyId
stringThe property id.
languageId
stringThe language id.
showUntranslated
boolShould 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
groupId
stringGroup id
Returns
- IList<VariantGroupProperty>
variantGroupProperties
GetVariantGroupsByProductId(string)
Gets the variant groups with options.
public IList<VariantGroup> GetVariantGroupsByProductId(string productId)
Parameters
productId
stringThe product id.
Returns
- IList<VariantGroup>
The IList<T>.
Save(VariantGroup)
Saves the current instance with the specified id.
public void Save(VariantGroup variantGroup)
Parameters
variantGroup
VariantGroup
Save(VariantGroupProductRelation)
public void Save(VariantGroupProductRelation relation)
Parameters
relation
VariantGroupProductRelation
Save(VariantGroupProperty)
Saves group property
public void Save(VariantGroupProperty variantGroupProperty)
Parameters
variantGroupProperty
VariantGroupPropertyThe variant group property.
SaveValue(string, string, string, string)
Saves group property value
public void SaveValue(string optionId, string propertyId, string languageId, string propertyValue)
Parameters
optionId
stringThe option id
propertyId
stringThe property id
languageId
stringThe language id
propertyValue
stringThe property value
VariantGroupCounter(string)
Gets the product relations count.
public int VariantGroupCounter(string productId)
Parameters
productId
stringThe product.
Returns
- int
Count of the relations.