Product Provider Web Part

The Product Provider Web Part retrieves a set of properties from Commerce Server 2009, and then dispenses these properties through a Web Part connection. The selection of the properties to retrieve is based on the properties selected by consumer Web Parts. The Product Provider Web Part builds a master list of properties by requesting each consumer Web Part to submit its list of properties to retrieve. This logic is performed during runtime, thus ensuring the Product Provider Web Part will compile the most up to date list of properties.

Each consumer Web Part implements an interface that provides a method for the Provider Web Part to call in order to retrieve the properties of the Web Part. In addition, consumer Web Parts are able to make use of a Web Part parameter pane option to let the user set the list of properties, thus affecting the properties retrieved by the Provider Web Part.

In addition to the selection of individual product properties, relationships are selectable. These relationships are:

  • Variants

  • Related items

  • Cross sells

  • Up sells

  • Custom relationships

The Product Provider Web Part is headless, meaning that no evidence of its existence is shown on the Product Details page outside of Edit mode. The Product Provider Web Part is responsible for retrieving product properties and variant properties along with other attributes, such as custom relationships, variants, cross sells, and up sells. By leveraging Web Part connections, the Product Provider Web Part can feed product information to other Web Parts. Having one Web Part communicate with Commerce Server 2009 lets you abstract this functionality from other Web Parts to focus solely on rendering data.

The Product Provider Web Part supports the following URL parameters, which are provided automatically by the site map providers:

  • The category name or ID

  • The product ID to retrieve properties about

There is a maximum of one Product Provider Web Part on any Product Details page. This is enforced at design time. Any Web Parts that require the Product Provider Web Part to be present emit an appropriate error or warning message to that effect when positioned on a site page.

Architecture

The sequence of actions of how this Web Part works is:

  1. The product identification is provided a configurable query parameter and is consumed by the Product Provider Web Part.

  2. The Product Provider Web Part builds a master list of product properties and variant properties to retrieve from all connected consumer Web Parts.

  3. The Product Provider Web Part retrieves a product based on the product identification, and the list of product properties and variant properties to retrieve.

  4. The product object is provided to other consumer Web Parts through Web Part connections.

Properties

The following table lists the mapping of the properties for the Product Provider Web Part.

Property

Maps to

Catalog

Catalog

"Catalog" URL parameter

CatalogUrlKey

"Category Id" URL parameter

CategoryIdUrlKey

Channel

Channel

Include "Cross -Sells"

IncludeCrossSells

Include "Relationships"

IncludeRelationships

Include "Up-Sells"

IncludeUpSells

Include "Variants"

IncludeVariants

"Product Id" URL parameter

ProductIdUrlKey

Product Page Title

ProductPageTitle

Customization

The Product Provider Web Part is not responsible for rendering any HTML so there is no customization required, other than error message handling.

Error Handling

There is no design-time error handing required for this Web Part.

See Also

Other Resources

Developing with SharePoint Commerce Services

Catalog System Web Parts

Working With the Product Provider Web Part