Loading...
Area: Episerver Commerce
Applies to versions: 12.1 and higher

Order management

Recommendations [hide]

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

    ordermanagementscreen.png

    From Order Management you create and modify carts and purchase orders, and access information on customer profiles. See the Episerver User Guide.

    Extending 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 [New in Commerce 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, the following error appears.

    com10123.png

    To replace this 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;
        }
    }

    Related topics

    Do you find this information helpful? Please log in to provide feedback.

    Last updated: Jun 23, 2020

    Recommendations [hide]