New in 8.2.1 Update-3

Sitecore Commerce 8.2.1 Update 3 introduces the following new or changed functionality to improve Sitecore Commerce features.

New SelectedCurrency cookie to support switching currency at runtime

Sitecore Commerce 8.2.1 Update 3 introduces support for a new cookie called SelectedCurrency that allows you to set the shopping cart currency at runtime (instead of relying on the value set in a configuration file).

When the cookie is present in the HTTP request, for example from your custom Storefront site, Commerce Engine Connect uses the value specified in the cookie to set the currency in the HTTP header of the call to the Commerce Engine.

Performance optimization for cache refresh

Sitecore Commerce 8.2.1 Update 3 introduces two new settings to optimize performance as it relates to cache refresh. The settings are contained in a new configuration file (Website\App_Config\Include\CommerceServer\CommerceServer.Catalog.Cache.Overrides.config).
  • Sitecore.Commerce.Catalog.Cache.Refresh.DisableAutoRefreshRemoteEvent: allows you to turn off auto cache refresh for remote servers, thereby avoiding excessive cache refresh triggers on other Sitecore Commerce instances.

    For example, when enabled, editing a catalog item on the Content Management server does not trigger a similar cache refresh on the Content Delivery server before publishing catalog changes from CM to CD. (Note, however in a Content Management farm environment, that the catalog cache may become stale if you make numerous updates and do not refresh the cache manually on other CM servers.) If set to "false, current default behavior applies and a cache refresh on the local server triggers a cache refresh on remote servers.

  • Sitecore.Commerce.Catalog.Cache.Refresh.Override: allows you to clear catalog items from the HTTP cache without affecting any non-catalog items which also reside in the HTTP cache. This helps avoid a refresh on these non-catalog cache entries that have not changed. If set to "false", the current default behavior applies and a catalog cache refresh clears all cache entries.

To activate these settings, you must remove the ".disabled" extension from the file name.

Inventory associated with a virtual catalog

If you want to use inventory that is associated with a virtual catalog, you must include the following policy in all applicable environment configuration (.json) files (for example, C:\inetpub\CommerceAuthoring\wwwroot\data\Environments\PlugIn.Habitat.CommerceShops-1.0.0.json):

{
   "$type":
       "Sitecore.Commerce.Plugin.Catalog.Cs.CsSellableItemCatalogNamePolicy,Sitecore.Commerce.Plugin.Catalog.Cs",
       "UseVirtualCatalogNameForInventory": true
},
Note: If you leave the UseVirtualCatalogNameForInventory value as false or do not include the policy in the environment files, the system keeps the default behavior and uses inventory associated with the base catalog(s) for the virtual catalog.

After you change the environment file(s), you must Bootstrap the Commerce Engine and restart the corresopnding Commerge Engine service to make sure the changes are stored in the global database. You can use the Postman sample (as described in Bootstrap the Commerce Engine) or paste the following URL into a browser: http://localhost:5000/commerceops/Bootstrap().

Custom properties in Customer and Orders Manager

You can now add custom properties to a Commerce Server Profile to display in the Customer and Orders Manager. Follow these steps:
  1. Extend the profile system with the appropriate custom properties, according to the instructions in "Extending the Profiles System" as descrbed in the Commerce Server documentation (typically installed under C:\Program Files (x86)\Commerce Server 11\Documentation\EN\CommerceServerHelp.chm).

    The instructions include steps to extend the profile database schema, add data members in the “User Object” and “Addresses” data sources, and add custom properties for “User Object” and “Address” profile definitions.

  2. Add new policies to the environment configuration (.json) files to include the new custom properties (for example, CommerceAuthoring\wwwroot\data\Environments\PlugIn.Habitat.CommerceAuthoring-1.0.0.json).
    1. To include the User Object property, use the format below for your policy. In this example, the new profile property name in the Commerce Server Profile system is GeneralInfo.CustomUserObjectProperty1.
      {
            "$type": 
               "Sitecore.Commerce.Plugin.Customers.Cs.ProfilePropertiesMappingPolicy, Sitecore.Commerce.Plugin.Customers.Cs",
                 "ProfileProperties": {
                    "CustomUserObjectProperty1": "GeneralInfo.CustomUserObjectProperty1"
                 }
      }
    2. To include the Address property, use the format below for your policy. In this example, the new profile property name in the Commerce Server Profile system is GeneralInfo.CustomCustomAddresssProperty1.
      {
            "$type": "Sitecore.Commerce.Plugin.Customers.Cs.PartyProfilePropertiesMappingPolicy, Sitecore.Commerce.Plugin.Customers.Cs",
                "PartyProfileProperties": {
                    "CustomAddressProperty1": "CustomAddressProperty1"
                 }
      }
      Note: You only need to add custom properties. There is no property group prefix required for the custom Address property (for example, GeneralInfo).
  3. Bootstrap the Commerce Engine and restart the corresopnding Commerge Engine service to make sure the changes are stored in the global database. You can use the Postman sample (as described in Bootstrap the Commerce Engine) or paste the following URL into a browser: http://localhost:5000/commerceops/Bootstrap().
  4. Launch the Customer and Order Manager tool (from the Sitecore Launchpad) to verify that the customer properties are present.