Partager via


Definitions in the catalog system

        Definitions, like properties form a part of the catalog schema definition. A catalog definition consists of a collection of properties and serves as a template for creating products and categories in a catalog. There are two types of definitions:

Category definitions which are used to create categories.

Product definitions which are used to create products and product families.

 

        You can create a definition by calling the CatalogManager.CreateCategoryDefinition or CatalogManager.CreateProductDefinition methods. Once you create a definition you can add properties to the definition by calling the  CatalogManager.AddDefinitionProperty and  CatalogManager.AddDefinitionVariantProperty methods. A property added to a definition has an attribute named PropertyOrder thereby allowing you to order the properties in a definition. You can set the PropertyOrder for a property by calling the CatalogManager.GetDefinitionProperties method, updating the  propertyorder for the properties in the recordset  and then passing the recordset to the CatalogManager.SetDefinitionProperties method. The Product.GetProductProperties and Category.GetCategoryProperties methods return a recordset containing the values for the product and category properties. The columns in this recordset contain the built in properties and the properties in the corresponding definition. These properties (columns) in the recordset are ordered by the propertyorder.

 

Products and Product Families

    A product in a catalog is a directly sellable product. For eg you can create a product definition named Soccer Shirts with properties Manufacturer, Description, Color, Size etc and then create a product for each Description, Color, size combination. This catalog contains three soccer shirts from the same manufacturer.

       

ProductId Manufacturer Description Color Size
SKU11 Xyz Company A soccer shirt Red 25
SKU12 Xyz Company A soccer shirt Red 30
SKU13 Xyz Company A soccer shirt Blue 25
         

   

    Products can also be arranged into groups of closely related items, which are called product families. A product family is a (logical) container for a group of similar products which differ in just a few properties. These individual differing products are called product variants, which like products are directly sellable units. Unlike products, a product family is not a directly sellable unit. In the above example, since the Manufacturer and Description are the same for all the Soccer shirts whereas only the Color and Size differ you can create a product definition which has Manufacturer and Description as normal properties and Color and size as variant properties. Based on this definition you can create a product family which defines the Manufacturer and Description and then create variants for each varying Color, size combination. The product hierarchy in your catalog  will then look like

 

ProductId VariantId Manufacturer Description Color Size
SKU1   Xyz Company A soccer shirt    
SKU1 SKU11 Xyz Company A soccer shirt Red 25
SKU1 SKU12 Xyz Company A soccer shirt Red 30
SKU1 SKU13 Xyz Company A soccer shirt Blue 25
           

 

    Note that the Product Family (first row) defines the Manufacturer and Description for the product. The variants which are directly sellable units (rows 2 - 4) inherit the values for the productid,Manufacturer and Description  from its product family and define values for the variant properties (Color and Size). Values inherited by product variants from the normal properties of the product family (Manufacturer in above example) cannot be changed.

 

    When you create a product based on a product definition, whether a regular product or a product family is created  depends on if the definition contains variant properties or not. If a product definition does not contain variant properties then a regular product is created and if a product definition contains variant properties then a product family is created.

Comments