Class ProductCategoryService
- Namespace
- Dynamicweb.Ecommerce.Products.Categories
- Assembly
- Dynamicweb.Ecommerce.dll
public class ProductCategoryService : ICacheStorage<string, Category>, ICacheStorage<string>, ICacheStorage
- Inheritance
-
Product
Category Service
- Implements
- Inherited Members
Methods
AddFieldToCategory(Category, Field)
Adds a Field to the category. Also adds a language version of the Field to each language version of the category.
Parameters
AddFieldToCategory(Category, string, string, string, string, string, FieldListPresentationType)
Adds a Field to the category. Also adds a language version of the Field to each language version of the category.
public void AddFieldToCategory(Category theCategory, string systemName, string label, string templateTag, string type, string defaultValue, FieldListPresentationType presentation)
Parameters
theCategory
CategorysystemName
stringThe SystemName of the field.
label
stringThe Label of the field.
templateTag
stringtype
stringThe type of the field.
defaultValue
stringpresentation
FieldList Presentation Type
AddFieldToCategory(Category, string, string, string, string, string, FieldListPresentationType, int)
Adds a Field to the category. Also adds a language version of the Field to each language version of the category.
public void AddFieldToCategory(Category theCategory, string systemName, string label, string templateTag, string type, string defaultValue, FieldListPresentationType presentation, int sortOrder)
Parameters
theCategory
CategorysystemName
stringThe SystemName of the field.
label
stringThe Label of the field.
templateTag
stringtype
stringThe type of the field.
defaultValue
stringpresentation
FieldList Presentation Type sortOrder
int
AddFieldToCategory(Category, string, string, string, string, string, FieldListPresentationType, int, string)
Adds a Field to the category. Also adds a language version of the Field to each language version of the category.
public void AddFieldToCategory(Category theCategory, string systemName, string label, string templateTag, string type, string defaultValue, FieldListPresentationType presentation, int sortOrder, string description)
Parameters
theCategory
CategorysystemName
stringThe SystemName of the field.
label
stringThe Label of the field.
templateTag
stringtype
stringThe type of the field.
defaultValue
stringpresentation
FieldList Presentation Type sortOrder
intdescription
string
ClearCache()
Resets all keys to the default value for objects stored in the object cache
ClearCache(IEnumerable<string>)
Resets the specified keys to the default value for objects stored in the object cache
Parameters
keys
IEnumerable<string>Keys to reset
ClearCache(string)
Resets the specified key to the default value for objects stored in the object cache
Parameters
key
stringKey to reset
ClearCategoryCache()
Clears category cache.
ClearFieldCache()
Clears fields cache.
CreateCategory(string)
Creates a new Category object with the given parameters and saves it to the database. In addition a Category object is creates for all current eCommerce Languages. The ID of the object is auto-generated. The Dynamicweb.Ecommerce.International.Language of the object is set to Context.Language.
Parameters
name
stringThe Name of the object.
Returns
CreateCategory(string, string)
Creates a new Category object with the given parameters and saves it to the database.
Parameters
Returns
CreateCategory(string, string, CategoryType)
Creates a new Category object with the given parameters and saves it to the database.
Parameters
systemName
stringThe SystemName of the object.
name
stringThe Name of the object.
categoryType
CategoryType The category type.
Returns
CreateField(string, Category, string, string, string)
Creates a new Field object.
public Field CreateField(string id, Category category, string templateTag, string label, string type)
Parameters
Returns
CreateField(string, Category, string, string, string, string, FieldListPresentationType, string)
Creates a new Field object.
public Field CreateField(string id, Category category, string templateTag, string label, string type, string defaultValue, FieldListPresentationType presentation, string description)
Parameters
id
stringcategory
CategorytemplateTag
stringlabel
stringtype
stringdefaultValue
stringpresentation
FieldList Presentation Type description
string
Returns
DeleteCategory(Category)
Deletes the Category and all fields associated, and all language versions.
Parameters
theCategory
Category
DeleteCategoryTranslation(Category, string)
Parameters
DeleteField(Field)
Deletes the field.
Parameters
theField
FieldThe field to remove.
GetCategories()
Returns all categories from database.
Returns
- IEnumerable<Category>
A collection of categories containing 0 or more items.
GetCategories(Product)
Parameters
product
ProductThe product.
Returns
- IEnumerable<Category>
A collection of categories containing 0 or more items.
GetCategories(Product, bool)
Parameters
product
ProductThe product.
includeProductProperties
boolDetermines whether product properties should be included in result.
Returns
- IEnumerable<Category>
A collection of categories containing 0 or more items.
GetCategoriesUsages()
Returns
GetCategoryById(string)
Returns the Category with the given ID. The default Language is used.
Parameters
Returns
GetCategoryUsageCount(string, bool)
Parameters
Returns
GetCategoryUsageReferences(string, bool, int, int, string, string)
public IEnumerable<CategoryUsage> GetCategoryUsageReferences(string categoryId, bool productUsages, int pageNumber = 1, int pageSize = 100, string orderBy = null, string orderByDirection = null)
Parameters
categoryId
stringproductUsages
boolpageNumber
intpageSize
intorderBy
stringorderByDirection
string
Returns
GetFields()
Returns
GetFields(string)
Parameters
languageId
string
Returns
GetFieldsByCategoryId(string)
Parameters
categoryId
string
Returns
GetGroupCategoryFieldValue(Group, Field, bool)
Gets the category field value.
public FieldValueAndInheritanceInformation GetGroupCategoryFieldValue(Group group, Field field, bool allowFallback)
Parameters
group
GroupThe group information.
field
FieldThe field.
allowFallback
boolSpecifies if fallback values should be used, when the group does not yield a value.
Returns
- Field
Value And Inheritance Information category field value
GetProductCategoryFieldValue(Product, Field)
Gets the category field value.
public FieldValueAndInheritanceInformation GetProductCategoryFieldValue(Product product, Field field)
Parameters
Returns
- Field
Value And Inheritance Information category field value
GetUsageCount(Category)
Parameters
category
Category
Returns
GetUsageGroupsAsCollection(Category)
Parameters
category
Category
Returns
ParseFieldValue(Field, object)
Parameters
Returns
- object
The parsed value.
ParseFieldValue(object, int)
Parameters
Returns
- object
The parsed value.
SaveCategory(Category)
Saves the Category.
Parameters
theCategory
Category
SaveField(Field)
Saves this instance.
Parameters
theField
Field
ShowField(Field, Product)
Return a boolean, which indicates whether or not the field should be shown. This is calculated based on the 'HideIfFieldHasNoValue' and the value of the field.