Class Category
- Namespace
- Dynamicweb.Ecommerce.Products.Categories
- Assembly
- Dynamicweb.Ecommerce.dll
The class Category represents product category.
[Serializable]
public class Category
- Inheritance
-
Category
- Inherited Members
Properties
CategoryType
public CategoryType CategoryType { get; set; }
Property Value
Fields
The fields belonging to this Dynamicweb.eCommerce.Products.Categories.Category object.
[Obsolete("Use Services.ProductCategoryFields.GetFieldsByCategoryId instead.")]
public FieldCollection Fields { get; }
Property Value
Id
Returns the ID of the current Dynamicweb.eCommerce.Products.Categories.Category.
public string Id { get; }
Property Value
Remarks
0 indicates a new Dynamicweb.eCommerce.Products.Categories.Category.
IsNew
Indicates whether this Dynamicweb.eCommerce.Products.Categories.Category is new.
public bool IsNew { get; }
Property Value
Language
Gets the language for this Dynamicweb.eCommerce.Products.Categories.Category.
[Obsolete("Use Translations instead.")]
public Language Language { get; set; }
Property Value
Name
Gets or sets the name of this Dynamicweb.eCommerce.Products.Categories.Category.
[Obsolete("Use GetName and SetName instead.")]
public string Name { get; set; }
Property Value
ProductProperties
Gets or sets the name of this Dynamicweb.eCommerce.Products.Categories.Category.
[Obsolete("Use CategoryType instead")]
public bool ProductProperties { get; set; }
Property Value
Translations
Gets the translations for the current entity
public TranslationCollection<CategoryTranslation> Translations { get; }
Property Value
Methods
AddField(Field)
Adds a Dynamicweb.eCommerce.Products.Categories.Field to the Dynamicweb.eCommerce.Products.Categories.FieldCollection of this Dynamicweb.eCommerce.Products.Categories.Category.
Also adds a language version of the Dynamicweb.eCommerce.Products.Categories.Field to each language version of this Dynamicweb.eCommerce.Products.Categories.Category.
[Obsolete("Use Services.ProductCategories.AddFieldToCategory() instead.")]
public void AddField(Field field)
Parameters
field
Field- The Dynamicweb.eCommerce.Products.Categories.Field to add.
AddField(string, string, string, string, string, FieldListPresentationType, FieldOptionCollection)
Adds a Dynamicweb.eCommerce.Products.Categories.Field to the Dynamicweb.eCommerce.Products.Categories.FieldCollection of this Dynamicweb.eCommerce.Products.Categories.Category.
Also adds a language version of the Dynamicweb.eCommerce.Products.Categories.Field to each language version of this Dynamicweb.eCommerce.Products.Categories.Category.
[Obsolete("Use Services.ProductCategories.AddFieldToCategory() instead.")]
public void AddField(string systemName, string label, string templateTag, string type, string defaultValue, FieldListPresentationType presentation, FieldOptionCollection options)
Parameters
systemName
string- The SystemName of the Dynamicweb.eCommerce.Products.Categories.Field.
label
string- The Label of the Dynamicweb.eCommerce.Products.Categories.Field.
templateTag
stringtype
string- The type of the Dynamicweb.eCommerce.Products.Categories.Field.
defaultValue
stringpresentation
FieldListPresentationTypeoptions
FieldOptionCollection
AddField(string, string, string, string, string, FieldListPresentationType, FieldOptionCollection, int)
Adds a Dynamicweb.eCommerce.Products.Categories.Field to the Dynamicweb.eCommerce.Products.Categories.FieldCollection of this Dynamicweb.eCommerce.Products.Categories.Category.
Also adds a language version of the Dynamicweb.eCommerce.Products.Categories.Field to each language version of this Dynamicweb.eCommerce.Products.Categories.Category.
[Obsolete("Use Services.ProductCategories.AddFieldToCategory() instead.")]
public void AddField(string systemName, string label, string templateTag, string type, string defaultValue, FieldListPresentationType presentation, FieldOptionCollection options, int sortOrder)
Parameters
systemName
string- The SystemName of the Dynamicweb.eCommerce.Products.Categories.Field.
label
string- The Label of the Dynamicweb.eCommerce.Products.Categories.Field.
templateTag
stringtype
string- The type of the Dynamicweb.eCommerce.Products.Categories.Field.
defaultValue
stringpresentation
FieldListPresentationTypeoptions
FieldOptionCollectionsortOrder
int
AddField(string, string, string, string, string, FieldListPresentationType, FieldOptionCollection, int, string)
Adds a Dynamicweb.eCommerce.Products.Categories.Field to the Dynamicweb.eCommerce.Products.Categories.FieldCollection of this Dynamicweb.eCommerce.Products.Categories.Category.
Also adds a language version of the Dynamicweb.eCommerce.Products.Categories.Field to each language version of this Dynamicweb.eCommerce.Products.Categories.Category.
[Obsolete("Use Services.ProductCategories.AddFieldToCategory() instead.")]
public void AddField(string systemName, string label, string templateTag, string type, string defaultValue, FieldListPresentationType presentation, FieldOptionCollection options, int sortOrder, string description)
Parameters
systemName
string- The SystemName of the Dynamicweb.eCommerce.Products.Categories.Field.
label
string- The Label of the Dynamicweb.eCommerce.Products.Categories.Field.
templateTag
stringtype
string- The type of the Dynamicweb.eCommerce.Products.Categories.Field.
defaultValue
stringpresentation
FieldListPresentationTypeoptions
FieldOptionCollectionsortOrder
intdescription
string- The description of the Dynamicweb.eCommerce.Products.Categories.Field.
ClearCache()
Remove dictionary from cache
[Obsolete("Use Services.ProductCategories.ClearCategoryCache() instead.")]
public static void ClearCache()
Create(string)
Creates a new Dynamicweb.eCommerce.Products.Categories.Category object with the given parameters and saves it to the database.
In addition a Dynamicweb.eCommerce.Products.Categories.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.
[Obsolete("Use Services.ProductCategories.CreateCategory() instead.")]
public static Category Create(string name)
Parameters
name
string- The Name of the object.
Returns
- Category
- The language version of the Dynamicweb.eCommerce.Products.Categories.Category related to the Default eCommerce Language.
Create(string, string)
Creates a new Dynamicweb.eCommerce.Products.Categories.Category object with the given parameters and saves it to the database.
In addition a Dynamicweb.eCommerce.Products.Categories.Category object is creates for all current eCommerce Languages.
[Obsolete("Use Services.ProductCategories.CreateCategory() instead.")]
public static Category Create(string systemName, string name)
Parameters
Returns
- Category
- The language version of the Dynamicweb.eCommerce.Products.Categories.Category related to the Default eCommerce Language.
Create(string, string, bool)
Creates a new Dynamicweb.eCommerce.Products.Categories.Category object with the given parameters and saves it to the database.
In addition a Dynamicweb.eCommerce.Products.Categories.Category object is creates for all current eCommerce Languages.
[Obsolete("Use Services.ProductCategories.CreateCategory() instead.")]
public static Category Create(string systemName, string name, bool productProperties)
Parameters
systemName
string- The SystemName of the object.
name
string- The Name of the object.
productProperties
bool- The value indicates whether category is used fo product properties.
Returns
- Category
- The language version of the Dynamicweb.eCommerce.Products.Categories.Category related to the Default eCommerce Language.
Delete()
Deletes the current Dynamicweb.eCommerce.Products.Categories.Category and all fields associated, and all Language Versions.
[Obsolete("Use Services.ProductCategories.DeleteCategory() instead.")]
public void Delete()
GetAllCategories()
Returns all Dynamicweb.eCommerce.Products.Categories.Category objects from database.
[Obsolete("Use Services.ProductCategories.GetCategories() instead.")]
public static IList<Category> GetAllCategories()
Returns
- IList<Category>
- Dynamicweb.eCommerce.Products.Categories.List(Of Category) containing 0 or more Dynamicweb.eCommerce.Products.Categories.Category objects.
GetCategories()
Returns all Dynamicweb.eCommerce.Products.Categories.Category objects from database.
[Obsolete("Use Services.ProductCategories.GetCategories() instead.")]
public static CategoryCollection GetCategories()
Returns
- CategoryCollection
- Dynamicweb.eCommerce.Products.Categories.List(Of Category) containing 0 or more Dynamicweb.eCommerce.Products.Categories.Category objects.
GetCategories(string)
Returns all Dynamicweb.eCommerce.Products.Categories.Category objects from database matching the given Language ID.
[Obsolete("Use Services.ProductCategories.GetCategories() instead.")]
public static CategoryCollection GetCategories(string languageId)
Parameters
languageId
string
Returns
- CategoryCollection
- Dynamicweb.eCommerce.Products.Categories.List(Of Category) containing 0 or more Dynamicweb.eCommerce.Products.Categories.Category objects.
GetCategoriesByLanguage(string)
Returns all Dynamicweb.eCommerce.Products.Categories.Category objects from database matching the given Language ID.
[Obsolete("Use Services.ProductCategories.GetCategories() instead.")]
public static IList<Category> GetCategoriesByLanguage(string languageId)
Parameters
languageId
string
Returns
- IList<Category>
- Dynamicweb.eCommerce.Products.Categories.List(Of Category) containing 0 or more Dynamicweb.eCommerce.Products.Categories.Category objects.
GetCategoryById(string)
Returns the Dynamicweb.eCommerce.Products.Categories.Category with the given ID. The default Language is used.
[Obsolete("Use Services.ProductCategories.GetCategoryById() instead.")]
public static Category GetCategoryById(string categoryId)
Parameters
categoryId
string- The ID of the Dynamicweb.eCommerce.Products.Categories.Category to find.
Returns
- Category
- Dynamicweb.eCommerce.Products.Categories.Category otherwise Null
GetCategoryById(string, string)
Returns the Dynamicweb.eCommerce.Products.Categories.Category with the given ID and Language ID.
[Obsolete("Use Services.ProductCategories.GetCategoryById(string categoryId) instead.")]
public static Category GetCategoryById(string categoryId, string languageId)
Parameters
categoryId
string- The ID of the Dynamicweb.eCommerce.Products.Categories.Category to find.
languageId
string- The LanguageID of the Dynamicweb.eCommerce.Products.Categories.Category to find.
Returns
- Category
- Dynamicweb.eCommerce.Products.Categories.Category otherwise Null
GetName(string)
public string GetName(string languageId)
Parameters
languageId
string
Returns
RemoveField(Field)
Removes a Dynamicweb.eCommerce.Products.Categories.Field.
[Obsolete("Use Services.ProductCategories.DeleteField() instead.")]
public void RemoveField(Field field)
Parameters
field
Field- The Dynamicweb.eCommerce.Products.Categories.Field to remove.
Save()
Saves the current Dynamicweb.eCommerce.Products.Categories.Category.
[Obsolete("Use Services.ProductCategories.SaveCategory() instead.")]
public void Save()
SetName(string, string)
public void SetName(string languageId, string name)