Create values of a product attribute
To create a product attribute value, you must perform the following:
- Get the catalog manager.
Get an instance of the CatalogManager object.
- Get the parent attribute.
Get an instance of the specified parent attribute.
- Create new product attribute value.
To create new product attribute value, call the CreateProductAttributeValue method of the manager.
- Set the properties of the ProductAttributeValue instance.
In this example the following properties are set:
- Title
- Name
- IsActive
- Description
- Ordinal
- Associate the attribute value to the attribute.
To do this, set the Parent property to the instance of the parent attribute.
- Save the changes.
Save the changes to the catalog manager.
Use the following code sample: