Product attributes
The product attributes are used together with the variations of a product. Each attribute represents a characteristic of the product that can have different values. For example, such characteristic is the color of a product. If you want to create a variation based on the color, first you have to create an attribute with a value for each of the available colors.
For more information about variations, see the For developers: Product variations.
For more information about attribute values, see the For developers: Values of a product attribute.
To manage departments, products, product types and product attributes, you use the Telerik.Sitefinity.Modules.Ecommerce.Catalog.CatalogManager class.
The attributes are represented by the Telerik.Sitefinity.Ecommerce.Catalog.Model.ProductAttribute class. The class exposes the following specific properties:
- Id
Gets or sets the unique Guid of the attribute.
- Name
Gets or sets the programmatic name of the attribute.
- Title
Gets or sets the title of the attribute.
- IsActive
Indicates whether the attribute is active and can be used.
- ProductTypes
Represents a collection that contains information regarding the product types that the product attribute is applied to.
- TotalProductTypesCount
Gets the total count of product type that the attribute is applied to.
- ProductAttributeValues
Represents a collection that contains the values of the product attribute.
- TotalAttributeValuesCount
Gets the total count of the values of the attribute.
- AppliedTo
Gets or sets whether the attribute is applied to all product types or only to some of them. To apply to all product types, use a value of “0”. To apply to specified product types, use a value of “1” and populate the ProductTypes collection.
For more information about the different actions involving attributes, see the examples in the section below.