Share via


Commerce Foundation Category

A category is a container for products and other categories. A category is not a sellable unit with inventory, but it may have a list price that its child products can inherit. Every catalog has only one root category that is the logical beginning of the catalog tree hierarchy and that is accessible by using the catalog's RootCategory relationship. You cannot create or modify the root category.

Model

This commerce entity can be modified, as required. This model, taken from the out-of-the-box site, is provided as an example.

<CommerceEntity name="Category">
        <DisplayName value="Category" />
        <Description value="Product Catalog Category" />
        <EntityMappings>
          <EntityMapping
csType="Microsoft.CommerceServer.Catalog.Category"
csAssembly="Microsoft.CommerceServer.Catalog, Version=6.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
            <PropertyMappings>
              <!--The following mappings are required here to ensure that all
the product common properties are represented in the Microsoft Multi-Channel Commerce Foundation 
metadata. These are not returned by the Commerce Server
metadata automatically as the common properties.
   -->
              <PropertyMapping property="BaseCatalogName" csProperty="BaseCatalogName" />
              <PropertyMapping property="CatalogId" csProperty="CatalogName" />
              <PropertyMapping property="DefinitionName" csProperty="DefinitionName" />
              <PropertyMapping property="DisplayName" csProperty="DisplayName" />
              <PropertyMapping property="Id" csProperty="CategoryName" />
              <PropertyMapping property="IsVirtualCatalog" csProperty="IsVirtualCatalog" />
              <PropertyMapping property="ListPrice" csProperty="cy_list_price" />
              <PropertyMapping property="UseCategoryPricing" csProperty="UseCategoryPricing" />
              <PropertyMapping property="IsSearchable" csProperty="IsSearchable"/>
              <PropertyMapping property="DateModified" csProperty="LastModified"/>
              <PropertyMapping property="OriginalListPrice" csProperty="OriginalPrice" />
              <PropertyMapping property="InternalId" csProperty="Oid" />
              <PropertyMapping property="ParentInternalId" csProperty="ParentOid" />
            </PropertyMappings>

          </EntityMapping>
        </EntityMappings>
        <Properties>
          <!--The following property definitions are required here to ensure that all
the product common properties are represented in the Microsoft Multi-Channel Commerce Foundation 
metadata. These are not returned by the Commerce Server
metadata automatically as the common properties.
    -->
          <Property name="BaseCatalogName" dataType="String" >
            <DisplayName value="Base Catalog Name"/>
          </Property>
          <Property name="CatalogId" dataType="String" >
            <DisplayName value="Catalog Id"/>
          </Property>
          <Property name="DefinitionName"dataType="String" >
            <DisplayName value="Definition Name"/>
          </Property>
          <Property name="DisplayName" dataType="String" >
            <DisplayName value="Display Name"/>
          </Property>
          <Property name="Id"dataType="String" >
            <DisplayName value="Id"/>
          </Property>
          <Property name="IsVirtualCatalog" dataType="Boolean" isStronglyTyped="true" >
            <DisplayName value="Is Virtual Catalog"/>
          </Property>
          <Property name="ListPrice" dataType="Decimal" >
            <DisplayName value="List Price"/>
          </Property>
          <Property name="UseCategoryPricing" dataType="Boolean" >
            <DisplayName value="Use Category Pricing"/>
          </Property>
          <Property name="IsSearchable" dataType="Boolean">
            <DisplayName value="Is Searchable"/>
          </Property>
          <Property name="DateModified" dataType="DateTime">
            <DisplayName value="Date Modified"/>
          </Property>
          <Property name="OriginalListPrice" dataType="Decimal" >
            <DisplayName value="Original List Price"/>
          </Property>
          <Property name="InternalId" dataType="Integer" >
            <DisplayName value="Internal Id"/>
          </Property>
          <Property name="ParentInternalId" dataType="Integer">
            <DisplayName value="Parent Internal Id"/>
          </Property>
        </Properties>

        <Relationships>
          <!-- Catalog entity relationships -->
          <Relationship name="BaseCatalog" type="Relationship" modelName="Catalog" isMultipleItems="false" />
          <Relationship name="PrimaryParentCategory" type="Relationship" modelName="Category" isMultipleItems="false" />

          <!-- Hierarchical commerce entity relationships -->
          <Relationship name="AncestorCategories" type="Relationship" modelName="Category" isMultipleItems="true" />
          <Relationship name="CanonicalCategories" type="Relationship" modelName="Category" isMultipleItems="true" />
          <Relationship name="Discounts" type="Relationship" modelName="DiscountDefinition" isMultipleItems="true" />
          <Relationship name="ParentCategories" type="Relationship" modelName="Category" isMultipleItems="true" />
          <Relationship name="RelatedCategories" type="Relationship" modelName="Category" isMultipleItems="true" />
          <Relationship name="RelatedProducts" type="Relationship" modelName="Product" isMultipleItems="true" />

          <Relationship name="CrossSells" type="CatalogRelationship" modelName="HierarchicalCatalogEntity" isMultipleItems="true" >
            <DisplayName value="Cross-Sell Products" />
            <Description value="Cross-Sell Products" />
          </Relationship>

          <!-- Category specific relationships -->
          <Relationship name="ChildCategories" type="Relationship" modelName="Category" isMultipleItems="true" />
          <Relationship name="ChildProducts" type="Relationship" modelName="Product" isMultipleItems="true" />
        </Relationships>
      </CommerceEntity>

Properties

Property

Type

Description

BaseCatalogName

String

The name of the base catalog for this category.

CatalogId

String

ID (CatalogName) of the containing catalog.

DateModified

DateTime?

Date the commerce entity was modified. The value derives from LastModifed.

DefinitionName

String

Name of this object's definition.

DisplayName

String

Display name for this object.

Id

String

Unique identifier of the commerce entity. This value derives from the category name.

InternalId

int?

Maps to the Commerce Server object's object ID property, it is a unique DB key.

IsSearchable

bool?

Specifies if the IsSearchable property set to True.

IsVirtualCatalog

bool?

Type of Catalog.

If True: catalog is virtual

ListPrice

decimal?

List price for the category.

OriginalListPrice

decimal?

List price of the object when it was created.

ParentInternalId

int?

Maps to the Commerce Server object's object ID Property, it is a unique DB key.

UseCategoryPricing

bool?

Denotes whether the category pricing should be used.

Relationships

Property

Description

AncestorCategories

Relationship list of categories walking up the ancestral chain.

BaseCatalog

Relationship to the base catalog for this category.

CanonicalCategories

Relationship list of categories walking up the primary parent ancestral chain.

ChildCategories

Relationship list of all categories under this category.

ChildProducts

Relationship list of all products under this category.

CrossSells

Relationship list of all cross sells under this category.

DiscountDefinitions

Relationship list of all DiscountDefinition objects for this category from the Marketing System.

ParentCategories

Relationship list of all of this category’s parents.

PrimaryParentCategory

Relationship to the primary parent category for this object.

RelatedCategories

Relationship list of all of this category’s related categories.

RelatedProducts

Relationship list of all of this category’s related products.

Supported Operations

The following operations are supported for the Category entity:

Commerce Foundation CatalogEntity CommerceQuery

Commerce Foundation Catalog CommerceQuery

Commerce Foundation Category CommerceQuery

Commerce Foundation Product CommerceQuery

See Also

Other Resources

Developing with Commerce Server 2009

Developing with the Commerce Foundation Catalog System

Commerce Foundation CatalogEntity