HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket

Feature-specific configurations

Describes feature-specific configuration options available for Optimizely Customized Commerce

Depending on your specific solution and how you set up and work with Optimizely Customized Commerce, you can configure for example tracking execution and synchronization of versioning.

Configuration options

The configuration settings are available in the Appsettings.json file. The following example is from the Optimizely Commerce "Foundation" sample site.

"Commerce": {
      "SearchOptions": {
        "DefaultSearchProvider": "LuceneSearchProvider",
        "MaxHitsForSearchResults": 1000,
        "IndexerBasePath": "[appDataPath]/Foundation/SearchIndex",
        "IndexerConnectionString": "",
        "SearchProviders": [
          {
            "Name": "LuceneSearchProvider",
            "Type": "Mediachase.Search.Providers.Lucene.LuceneSearchProvider, Mediachase.Search.LuceneSearchProvider",
            "Parameters": {
              "queryBuilderType": "Mediachase.Search.Providers.Lucene.LuceneSearchQueryBuilder, Mediachase.Search.LuceneSearchProvider",
              "storage": "[appDataPath]/SearchIndex",
              "simulateFaceting": "true"
            }
          }
        ],
        "Indexers": [
          {
            "Name": "catalog",
            "Type": "Mediachase.Search.Extensions.Indexers.CatalogIndexBuilder, Mediachase.Search.Extensions"
          }
        ]
      },
      "MetaDataOptions": {
        "DisableVersionSync": true
      },
      "CatalogOptions": {
        "SalePriceTypes": [
          {
            "Key": "Subscription",
            "Value": "3",
            "Description": "Subscription"
          },
          {
            "Key": "MSRP",
            "Value": "4",
            "Description": "MSRP"
          }
        ]
      }
    }

Configuration details

Key Description
PromotionExclusionLevel Indicates if a promotion is excluded from being applied per order or per unit.
  • Order (default): Promotions are excluded from being applied to an order when excluded by other promotions.
  • Unit: Promotions can partly be prevented from being applied to one or more individual items when excluded by other promotions. Order level and shipping level promotions are still excluded in full.
    See also Promotion exclusions.
AutoMigrateEPiServer If set to true, when the site starts, the migration steps are run automatically. Otherwise, site admins must log in to the migration view and run the steps manually.
DisableVersionSync Indicates if an update to catalog content done outside of the content APIs removes version data (for example, drafts, old published versions) for affected content.
Setting this to true can improve the speed of batch operations done through the lower-level APIs (like ICatalogSystem), for example the catalog import.
See also Commerce 9 - upgrading and migration
episerver:tracking.Enabled Indicates if the Tracking system executes tracking.
See also Recommendations API overview.
episerver:personalization.BaseApiUrl The URL of the Optimizely Product Recommendations environment to be used. Should contain only the protocol and host name.
episerver:personalization.Site The site name used to identify requests to the tracking server.
episerver:personalization.ClientToken The token used to authenticate tracking requests to the REST API. See also Optimizely Recommendations.
episerver:personalization.AdminToken The token used to authenticate admin requests to the REST API.
episerver:personalization.RequestTimeout [Optional] Timeout for REST calls. The default value is 30 seconds.
episerver:personalization.TrackingMode [Optional] The tracking mode to use. Acceptable values are ServerSide and ClientSide.
To use the client side (JavaScript) tracking APIs, set this key to ClientSide. The default value is ServerSide.
episerver:personalization.CatalogFeedBatchSize [Optional] The number of products processed in one batch when the product feed is generated. A higher value can be faster but puts more pressure on the memory. Default value is 50.
See also Customizing exported product information.
episerver:personalization.CatalogNameForFeed [Optional] Selects the catalog used to generate the product feed if you have multiple catalogs. If this value is not set, the first catalog is used. See also Customizing exported product information.
Note: This property will be removed when Product feed support for multiple catalogs is added.
ExpiredCartJobDays For the Remove Expired Carts job, sets the number of days after the last modification before a cart is considered abandoned and removed by the job. Default value is 30 days.
episerver:ExpiredCartsRemovalJobExcludedCartName For the Remove Expired Carts job, sets the cart name that is excluded from being removed by the job, even if it has not been changed for a longer time than the configured value. Default value is "WishList".
episerver::DataBaseIndicesJobCommandTimeOut For the Maintenance Database Indices job, set the value (in seconds) before database requests are considered timeouts.
episerver::LowFragmentationThreshold For the Maintenance Database Indices job, sets the fragmentation value (in percent) of indices. If an index's  fragmentation level is below this value, it is not maintained. Default value is 10.
episerver::HighFragmentationThreshold For the Maintenance Database Indices job, sets the value (in percent).
  • Indices with a fragmentation level higher than this value will be rebuilt.
  • Indices with a fragmentation level lower than this value, but higher than the value configured by episerver::LowFragmentationThreshold will be reorganized.
Default value is 30.
episerver:commerce.UseLessStrictEntryUriSegmentValidation Indicates whether validation of entry uri segments should be strict or not.
  • Strict validation means uri segments must be globally unique (for the language) to make sure all hierarchical routes to entries will work despite any crosslinking that happens after the uri segment has been saved.
  • Less strict validation means that the uri segment is still validated for uniqueness against sibling items, but since this happens at the time of saving, crosslinking items can create conflicts in hierarchical routes.
Default value is false (that is, use strict validation).
See also URL segment and SEO URL and Increased Flexibility in Commerce Catalog URLs.
episerver:commerce.UriSegmentConflictsEmailRecipients Recipients that will get an email if any URI conflicts are found by the Find Catalog Uri Conflicts scheduled job. To specify multiple recipients, separate email addresses by a semicolon (;).
See also URL segment and SEO URL and Increased Flexibility in Commerce Catalog URLs.

Feature switch

The following features are provided as default by commerce through ApplicationOptions class.

Feature Enables State values Type
WorkflowsVNext The vnext version of workflows to run. See also: Workflows VNext.
  • Enabled : Workflows use the new promotion system.
  • Disabled: (default) Workflows use the old promotion system.
Mediachase.Commerce.Core.Features.WorkflowsVnext, Mediachase.Commerce
SerializedCarts Working with the serializable cart system.  
  • Enabled (default): Carts use the new (serializable) cart system.
  • Disabled: Carts use the old cart system.

Mediachase.Commerce.Core.Features.SerializedCarts, Mediachase.Commerce

Modify and add features

You can add or modify existing provided features using appsettings.json.

{
       "ApplicationOptions":{
          "Features":{
             "SerializedCarts":{
                "Feature":"SerializedCarts",
                "State":1, // 0 is enabled, 1 for disabled
                "Type":"Mediachase.Commerce.Core.Features.SerializedCarts, Mediachase.Commerce"
             },
             "MyownFeature":{
                "Feature":"CustomFeatureName",
                "State":1,
                "Type":"<CustomFeatureTypeName>, Mediachase.Commerce"
             }
          }
       }
    }