Configuration

There is a minor amount of configuration to the web.config file that is required to connect your Sitecore site with a Commerce Server site.

  1. Update the \App_Config\CommerceServer.Core.config.

  2. Register the Commerce Server Profile Provider.

  3. Add the caching configuration to the web.config.

  4. Choose Lucene or Solr.

The \Website\App_Config\CommerceServer.Core.config file is the recommended place to store your Commerce Server configurations. The Commerce Server Connect package includes a \Website\App_Config\CommerceServer.Core.config.example file to use as a starting point. In the CommerceServer.Core.config file, you will need to add the name of your Commerce Server site at Configuration/CommerceServer/Application[@siteName], and remove the configurations for any subsystems you are not using. For example, SCpbMD only uses the Catalog subsystem, so you could remove the Orders, Profiles,and other similar sections.

The \Website\MergeFiles\Merge.CommerceServer.config file contains all of the additional entries that you need to add to the web.config. Specifically it contains entries for registering the Commerce Server Profile Provider with the ASP.NET membership framework and the Enterprise Library Caching block. If you are not using the Commerce Server Profile sub system, then you do not need to merge in the profile provider piece. For example, if you are working with SCpbMD.

Previous releases of SCpbCS required you to add http modules in the web.config. This version provides Sitecore pipeline processor versions of these http modules. These pipeline processors are registered in the CommerceServer.config, inside the initialize, preprocessRequest, and httpRequestEnd pipelines. Because these processors are part of the Sitecore configuration framework, you are able to patch out pipeline processors for any subsystems you do not use. For example, if you are using SCpbMD, you would patch out all of the processors except for the catalog processor.

With these configuration changes, the Sitecore site will communicate with Commerce Server at start up. Before you start using your site, be aware of the following information about the Commerce Server Catalog integration:

  • When the Sitecore site starts, the Commerce Server Catalog DataProvider will iterate through all of the Inventory, Catalog, Product, and Category definitions to create an Item Template for each. If these Item Templates already exist, then the data provider will not re-create them, but will instead update them with any changes. You can manually force this update without restarting the site by using Update Item Templates in the Sitecore Commerce section of the ribbon.

  • The item templates that represent the Commerce Server definitions are only created in the Sitecore Master database. You will always need to publish these items to production.

  • By default, no catalogs appear in the Sitecore tree. You must select the catalogs you want to appear. Select the catalogs by browsing to /sitecore/Commerce/Catalog Management/Catalogs/, selecting the catalogs in the Selected Catalogs field, saving the item, and then collapsing and expanding the Catalogs node. You should now be able to browse through the catalog.

  • If browsing the catalog tree is slower than expected, you can enable Product Buckets by browsing to /sitecore/Commerce/Settings/Catalog/Product Buckets, and selecting the Value check box. This will hide all products from the tree, and you will only be able to access them through the Search tab in the Content Editing area. This imitates the behavior of Item Buckets. The Sitecore tree/API slows down when there are approximately more than 100 items under the same node. To work around this performance issue, the Product Buckets feature hides the product nodes. Another option is to organize your catalog so that there are no more than 100 child items in any section in the catalog.

  • When you expose a new catalog into the tree, it will not automatically be added to the search indexes. Go to the Indexing Manager, located at Start -> Control Panel -> Indexing -> Indexing Manager, and rebuild the indexes to add them.

If you are configuring an Azure Cloud Service or a web front end, you will want to remove the Commerce Server Staging ( Feature.MS.CS.CsStaging) and Profile Schema Manager (Feature.MS.CS.Misc) features from the list of features that are configured by the Commerce Server Configuration Wizard. Neither of these features are required on a web front end, and removing them will reduce the amount of additional configuration you need to perform.