Share via


Commerce Foundation Product

A product represents a sellable unit in a catalog, and is always a child of a category. A Commerce Server 2009 product can represent a Commerce Server RegularProduct or a ProductFamily. A product can also have variants.

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="Product">
    <DisplayName value="Product">
      <LanguageSpecific value="fr: Product" language="fr-CA"/>
    </DisplayName>
    <Description value="Product">
      <LanguageSpecific value="fr: Product" language="fr-CA"/>
    </Description>
    <EntityMappings>
      <EntityMapping csType="Microsoft.CommerceServer.Catalog.Product" csAssembly="Microsoft.CommerceServer.Catalog, Version=6.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
        <PropertyMappings>
          <PropertyMapping property="BaseCatalogName"  csProperty="BaseCatalogName" />
          <PropertyMapping property="CatalogId"  csProperty="CatalogName" />
          <PropertyMapping property="DefinitionName"  csProperty="DefinitionName" />
          <PropertyMapping property="DisplayName"  csProperty="DisplayName" />
          <PropertyMapping property="Id"  csProperty="ProductId" />
          <PropertyMapping property="IsVirtualCatalog"  csProperty="IsVirtualCatalog" />
          <PropertyMapping property="ListPrice"  csProperty="cy_list_price" />
          <PropertyMapping property="UseCategoryPricing"  csProperty="UseCategoryPricing" />
          <PropertyMapping property="OriginalListPrice"  csProperty="OriginalPrice" />
          <PropertyMapping property="InternalId"  csProperty="Oid" />
          <PropertyMapping property="OriginalProductId"  csProperty="OrigProductId" />
          <PropertyMapping property="ParentInternalId"  csProperty="ParentOid" />
          <PropertyMapping property="InventoryCondition"  csProperty="InventoryCondition"/>
          <PropertyMapping property="DateModified"  csProperty="LastModified"/>
        </PropertyMappings>
        <DefinitionMappings>
          <DefinitionMapping definitionName="Rock-Shoes"    csDefinitionName="Rockshoes" />
          <DefinitionMapping csDefinitionName="Boots">
        <PropertyMappings>
          <PropertyMapping property="Sole"  csProperty="SoleMaterial" />
        </PropertyMappings>
          </DefinitionMapping>
        </DefinitionMappings>
      </EntityMapping>
    </EntityMappings>
    <Properties>
      <Property name="BaseCatalogName" dataType="String" />
      <Property name="CatalogName" dataType="String" />
      <Property name="DefinitionName" dataType="String" />
      <Property name="DisplayName" dataType="String" />
      <Property name="Id" dataType="String" />
      <Property name="IsVirtualCatalog" dataType="Boolean" isStronglyTyped="1" />
      <Property name="ListPrice" dataType="Decimal" />
      <Property name="UseCategoryPricing" dataType="Boolean" />
      <Property name="CatalogId" dataType="String" />
      <Property name="DateModified" dataType="DateTime"/>
      <Property name="OriginalListPrice" dataType="Decimal" />
      <Property name="InternalId" dataType="Integer" />
      <Property name="OriginalProductId" dataType="String" />
      <Property name="ParentInternalId" dataType="Integer"/>
      <Property name="InventoryCondition" dataType="Integer" isStronglyTyped="true">
        <EnumeratedValues >
          <EnumerationEntry value="0">
        <DisplayName value="In Stock"/>
          </EnumerationEntry>
          <EnumerationEntry value="1">
        <DisplayName value="Pre Ordered"/>
          </EnumerationEntry>
          <EnumerationEntry value="2">
        <DisplayName value="Back Ordered"/>
          </EnumerationEntry>
          <EnumerationEntry value="3">
        <DisplayName value="Out of Stock"/>
          </EnumerationEntry>
        </EnumeratedValues>
      </Property>
      <Property name="IntroductionDate" dataType="Date">
        <DisplayName value="Date of Introduction">
          <LanguageSpecific value="fr: Date of Introduction" language="fr-CA"/>
        </DisplayName>
        <Description value="Product Introduction Date of Introduction">
          <LanguageSpecific value="fr: Product Introduction Date of Introduction" language="fr-CA"/>
        </Description>
        <Constraints>
          <Compare operator="LessThan" propertyToCompare="DiscontinueDate">
        <Message value="Date of Introduction must be less than Discontinue Date.">
          <LanguageSpecific value="fr: Date of Introduction must be less than Discontinue Date." language="fr-CA"/>
        </Message>
          </Compare>
        </Constraints>
      </Property>
      <Property name="Sole" dataType="Integer">
        <Description value="Material that the sole is made of" />
        <DefaultValue value="1"/>
        <!--When overriding an Enumerated property this entry is required even  if the Enumerated Values are not overriden.-->
        <EnumeratedValues>
          <EnumerationEntry value="0">
        <DisplayName value="Rubber">
          <LanguageSpecific value="Caoutchouté" language="fr-CA"/>
        </DisplayName>
          </EnumerationEntry>
        </EnumeratedValues>
        <Constraints>
          <clear/>
          <RequiredProperty>
        <Message value="Sole material must be specified" />
          </RequiredProperty>
        </Constraints>
      </Property>
    </Properties>
    <Relationships>
      <Relationship name="BaseCatalog" type="Relationship" modelName="Catalog" isMultipleItems="false"> </Relationship>
      <Relationship name="PrimaryParentCategory" type="Relationship" modelName="Category" isMultipleItems="false"> </Relationship>
      <Relationship name="AncestorCategories" type="Relationship" modelName="Category" isMultipleItems="true"> </Relationship>
      <Relationship name="CanonicalCategories" type="Relationship" modelName="Category" isMultipleItems="true"> </Relationship>
      <Relationship name="DiscountDefinitions" type="Relationship" modelName="DiscountDefinition" isMultipleItems="true"/>
      <Relationship name="ParentCategories" type="Relationship" modelName="Category" isMultipleItems="true"> </Relationship>
      <Relationship name="RelatedCategories" type="Relationship" modelName="Category" isMultipleItems="true"> </Relationship>
      <Relationship name="RelatedProducts" type="Relationship" modelName="Product" isMultipleItems="true"> </Relationship>
      <Relationship name="CrossSells" type="CatalogRelationship" modelName="HierarchicalCatalogEntity" isMultipleItems="true" >
        <DisplayName value="Cross-Sell Products">
          <LanguageSpecific value="fr: Cross-Sell Products" language="fr-CA"/>
        </DisplayName>
        <Description value="Cross-Sell Products">
          <LanguageSpecific value="fr: Cross-Sell Products" language="fr-CA"/>
        </Description> </Relationship>
      <Relationship name="Variants" type="Relationship" modelName="Variant" isMultipleItems="true" >
        <DisplayName value="Variants">
          <LanguageSpecific value="fr: Variants" language="fr-CA"/>
        </DisplayName>
        <Description value="Product Variants">
          <LanguageSpecific value="fr: Product Variants" language="fr-CA"/>
        </Description> </Relationship>
    </Relationships>
</CommerceEntity>

Properties

Property

Type

Description

BaseCatalogName

String

The name of the base catalog for this product.

CatalogId

String

ID (CatalogName) of the containing catalog.

CatalogName

String

The name of the catalog for this product.

DateModified

DateTime?

Date the commerce entity was modified. The value comes 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 comes from the category name.

InternalId

int?

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

InventoryCondition

int?

The inventory condition of this product's inventory item for the specified inventory catalog. Options include:

0 - In stock.

IsVirtualCatalog

bool?

Type of Catalog.

If True: catalog is virtual

ListPrice

decimal?

List price for this product.

OriginalListPrice

decimal?

List price of the object when it was created.

OriginalProductId

String

productId with which this object 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

List of categories walking up the ancestral chain.

BaseCatalog

Relationship to the containing base catalog for this object. This is the same as the catalog for non-virtual catalogs.

CanonicalCategories

List of categories walking up the primary parent ancestral chain.

CrossSells

Relationship list of all cross sells for this product.

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.

Variants

Relationship list of the product's variants.

Supported Operations

The product commerce entity supports the following operations:

Commerce Foundation CatalogEntity 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

Commerce Foundation InventoryItem

Commerce Foundation Product CommerceQuery