Configuration

Abstract

Configuration of the web.config file.

You must make modifications to the web.config file 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]. You should also remove configurations for 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, such as you are working with SCpbMD, then you do not need to merge in the profile provider piece.

Previous releases of SCpbCS required you to add http modules in the web.config, but there are now 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, this means you can patch out pipeline processors for subsystems you do not use. For example, if you are using SCpbMD you would patch out all of the processors except for catalog.

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 and 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, enable Product Buckets by browsing to /sitecore/Commerce/Settings/Catalog/Product Buckets, and select 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. The Product Buckets feature hides product nodes to work around this performance issue. Another option here is to organize your catalog so that there are no more than 100 child items at any point 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) from the list of features 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.