1. Commands and pipelines

Catalog mappings commands and pipelines

Version:

Catalog mappings represent relationships from Sitecore content tree items (in the Sitecore Content Editor) to the original corresponding Commerce Engine Catalog Items.

Catalog mappings represent relationships from Sitecore content items (in the Sitecore Content Editor) to the original corresponding Commerce Engine Catalog items.

It is possible for a catalog sellable item to appear in multiple locations within the Content Editor content tree. This happens, for example, when a sellable item appears under multiple categories. Because the Sitecore platform expects every item in the content tree to have a unique identifier (represented by the Item ID property in Content Editor), each occurrence of the same catalog item has a different Item Id value. In order to map and resolve these different instances of the same catalog item back to the original catalog entity ID, Commerce Engine Connect uses a catalog mappings system. The Catalog plugin defines commands and pipelines that allows retrieval of catalog mapping information.

The following table describes the catalog mappings commands and pipelines:

Command/Pipelines

Description

GetMappingsFromDbCommand

getCatalogMappingsPipeline

Returns the content of the catalog mappings table for any catalog that is selected in the Sitecore Content Editor.

GetCatalogMappingsForId

getCatalogMappingsPipeline

Returns the list of all catalog mappings for a specified sitecoreId parameter.

Parameter:

  • sitecoreId: represents a deterministic Id of a catalog item within the content tree in the Content Editor.

The Commerce Engine Connect uses the GetCatalogMappingsForId method to refresh the mappings of a single catalog item in the content tree (which could be used in multiple locations in the tree).

The method uses the sitecoreId to discover the original Commerce Engine item to which it is mapped. The Commerce Engine then uses the original item Id to construct a table of all the deterministic IDs for the item, and then returns the content to the caller.

This method is useful, for example, when a single item is updated in the XC Business Tool (for example, when a new entity version of a is added).

If you have suggestions for improving this article, let us know!