HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsGitHubNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Order management

Describes the Order Management user interface that lets customer representatives manage orders manually when needed in Optimizely Commerce Connect 13.

The Order Management user interface lets customer representatives manage orders manually when needed. Order Management is available from the Commerce Connect top menu.

From Order Management you create and modify carts and purchase orders, and access information on customer profiles.

Extend the search result display

When adding a new line item to a cart or an order, a user finds the correct one by searching for it. If a product has many variants, the system helps the user select the correct one by displaying variant-specific information (for example size or color) for each search hit. However, those properties differ from site to site. The system does a "best guess" by inspecting content types.

If you want more control over what is shown, use the EPiServer.Commerce.Catalog.IEntryInformation interface. By implementing IEntryInformation, and replacing our default implementation, you can customize which properties are displayed. The interface has just one method, which returns a dictionary. That dictionary should contain the names of properties to show, as well as a string representation of their value, suitable to be shown to the user.

public class CustomEntryInformation : IEntryInformation
    {
        IEntryInformation _defaultImplementation;
        public CustomEntryInformation(IEntryInformation defaultImplementation)
        {
            _defaultImplementation = defaultImplementation;
        }
    
        public IDictionary<string, string> GetCustomProperties(EntryContentBase entry)
        {
            var myVariant = entry as MyVariant;
            if (myVariant == null)
            {
                return _defaultImplementation.GetCustomProperties(entry);
            }
    
            return new Dictionary<string, string>() {
                { nameof(myVariant.Size), myVariant.Size.ToString() },
                { nameof(myVariant.Color), myVariant.Color } };
        }
    }
    
    public class MyVariant : VariationContent
    {
        public virtual int Size { get; set; }
        public virtual string Color { get; set; }
        public virtual int IntegrationCode { get; set; }
    }

Fix for "Customer is undefined" error – Commerce Connect 13.9.0

If a customer service representative  opens the Order Management user interface in two separate tabs, then logs out of the first tab and opens any cart or order on the second tab, an error appears.

To replace the error message with a user-friendly one ("Your session has expired"), add the following code to the Global.asax.cs file:

protected void Application_EndRequest()
    {
        if (Context.Response.StatusCode == 302
            && (Context.User == null || !Context.User.Identity.IsAuthenticated)
            && Context.Request.Path.ToString().ToLower().Contains("/api/"))
        {
            Context.Response.StatusCode = 401;
        }
    }