Table of Contents

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 string
Key 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()

ClearVariantGroupsCache()

Clears the variant groups cache
[Obsolete("Use ClearCache instead")]
public void ClearVariantGroupsCache()

CreateProductRelation(string, string)

public void CreateProductRelation(string productId, string variantGroupId)

Parameters

productId string
variantGroupId string

Delete(VariantGroup)

Deletes the variant group with the specified id.
public void Delete(VariantGroup variantGroup)

Parameters

variantGroup VariantGroup

Delete(string, string)

Deletes the variant group with the specified ID and Language id.
[Obsolete("Use DeleteVariantGroup(String) instead")]
public void Delete(string id, string languageId)

Parameters

id string
The id.
languageId string
The language id.

DeleteLanguageVariantGroup(string, string, bool)

Deletes the specified variant group.
[Obsolete("Use DeleteVariantGroup(String) instead")]
public void DeleteLanguageVariantGroup(string variantGroupId, string languageId, bool deleteVariants)

Parameters

variantGroupId string
languageId string
The language id.
deleteVariants bool
if set to true deletes variants.

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

optionId string
languageId string

DeleteProductRelation(ProductCollection)

Deletes instances with the specified parameters.
[Obsolete("Use DeleteProductRelations(IEnumerable(Of Product)) instead. Services should never return database related values.")]
public CommandBuilder DeleteProductRelation(ProductCollection products)

Parameters

products ProductCollection
The ProductCollection.

Returns

CommandBuilder
The CommandBuilder.

DeleteProductRelation(ProductCollection, bool)

Deletes instances with the specified parameters.
[Obsolete("Use DeleteProductRelations(IEnumerable(Of Product)) instead. Services should never return database related values.")]
public CommandBuilder DeleteProductRelation(ProductCollection products, bool execute)

Parameters

products ProductCollection
The ProductCollection.
execute bool
If True deletes will executed

Returns

CommandBuilder
The CommandBuilder.

DeleteProductRelation(string, string, string)

Deletes instances with the specified parameters.
public void DeleteProductRelation(string productId, string groupId = "", string relationId = "")

Parameters

productId string
The product id.
groupId string
The group id.
relationId string
The relation id.

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 VariantGroupProperty
The variant group property.

DeleteVariantGroupProperty(string)

Deletes instance with the specified parameters.
public void DeleteVariantGroupProperty(string id)

Parameters

id string
The 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

GetFilteredVariantGroups()

Gets the variant groups list in which 'family' and 'unit' groups are excluded.
public IList<VariantGroup> GetFilteredVariantGroups()

Returns

IList<VariantGroup>
The VariantGroupCollection.

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 VariantGroup
The 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 VariantGroup
The VariantGroup.
productId string
The product id.

Returns

IEnumerable<VariantGroupProductRelation>
The collection of the VariantGroupProductRelation.

GetProductRelations(string)

Gets the relations.
public IEnumerable<VariantGroupProductRelation> GetProductRelations(string productId)

Parameters

productId string
The product id.

Returns

IEnumerable<VariantGroupProductRelation>
The collection of the VariantGroupProductRelation.

GetUnits()

Gets all variant groups that are units.
public IList<VariantGroup> GetUnits()

Returns

IList<VariantGroup>

GetUnits(string)

Gets all variant groups that are units.
[Obsolete("Use GetUnits without arguments instead")]
public IList<VariantGroup> GetUnits(string languageId)

Parameters

languageId string
Language id

Returns

IList<VariantGroup>
variantGroups

GetVariantGroup(string)

public VariantGroup GetVariantGroup(string variantGroupId)

Parameters

variantGroupId string

Returns

VariantGroup

GetVariantGroup(string, string)

[Obsolete("Use GetVariantGroup(string) instead. To get translated values use VariantGroup.Translations")]
public VariantGroup GetVariantGroup(string languageId, string variantGroupId)

Parameters

languageId string
variantGroupId string

Returns

VariantGroup

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 string
The option id.
propertyId string
The property id.
languageId string
The language id.
showUntranslated bool
Should 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 string
Group id

Returns

IList<VariantGroupProperty>
variantGroupProperties

GetVariantGroups(string, bool)

Gets the variant groups.
[Obsolete("Use GetUnits() without arguments to get all variant groups which are unit. Use VariantGroup.Translations to get translated values.")]
public IList<VariantGroup> GetVariantGroups(string languageId, bool isUnit)

Parameters

languageId string
isUnit bool
The variant group is unit.

Returns

IList<VariantGroup>
The IList<T>.

GetVariantGroups(string, string)

Gets the variant groups with options.
[Obsolete("Use GetVariantGroupsByProductId(string) instead")]
public IList<VariantGroup> GetVariantGroups(string languageId, string productId)

Parameters

languageId string
productId string
The product id.

Returns

IList<VariantGroup>
The IList<T>.

GetVariantGroupsByLanguage(string)

Gets the variant groups by language.
[Obsolete("Use GetFilteredVariantGroups to get the list of groups without 'family' and 'unit' groups. Use VariantGroup.Translations to get translated values.")]
public IList<VariantGroup> GetVariantGroupsByLanguage(string languageId)

Parameters

languageId string

Returns

IList<VariantGroup>
The VariantGroupCollection.

Remarks

Result variant group list includes variant groups e.g. 'family' variant groups excluded from results

GetVariantGroupsByLanguage(string, bool)

Gets the variant groups by language.
[Obsolete("Use GetFilteredVariantGroups to get the list of groups without 'family' and 'unit' groups. Use VariantGroup.Translations to get translated values.")]
public IList<VariantGroup> GetVariantGroupsByLanguage(string languageId, bool showUntranslated)

Parameters

languageId string
showUntranslated bool

Returns

IList<VariantGroup>
The VariantGroupCollection.

Remarks

Result variant group list includes variant groups e.g. 'family' variant groups excluded from results

GetVariantGroupsByProductId(string)

Gets the variant groups with options.
public IList<VariantGroup> GetVariantGroupsByProductId(string productId)

Parameters

productId string
The 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 VariantGroupProperty
The 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 string
The option id
propertyId string
The property id
languageId string
The language id
propertyValue string
The property value

VariantGroupCounter(string)

Gets the product relations count.
public int VariantGroupCounter(string productId)

Parameters

productId string
The product.

Returns

int
Count of the relations.
To top