Use the customer sample solution

Current version: 10.0

Sitecore Experience Commerce (XC) includes a sample solution that you can use as a starting point for extending the Commerce Engine. This sample solution (Customer.Sample.Solution) is part of the Sitecore.Commerce.Engine.SDK. Sitecore also provides a sample plugin project template, which is available from the Official Sitecore Commerce NuGet Feed.

Important

When you work with the Sitecore.Commerce.Engine.SDK, you must use Visual Studio 2019.

The Customer.Sample.Solution contains:

  • The Sitecore.Commerce.Engine project (an ASP.NET Core host).

  • Sample plugins, including:

    • Plugin.Sample.AdventureWorks - sample data that you can use to develop and test your solution.

    • Plugin.Sample.ContentHub - Content Hub integration. This sample plugin requires that you create a Stylelabs account.

    • Plugin.Sample.Habitat- sample data that you can use to develop and test your solution.

    • Plugin.Sample.Payments.Braintree - working Braintree payment integration.

The Sitecore.Commerce.Engine.SDK also contains the Sitecore.Commerce.Sample.Console.sln, which is a sample console application that provides samples and allows the end-to-end demonstration and functional tests of standard scenarios. You can load it in a second Visual Studio instance, and enhance it by either removing unnecessary scenarios, or adding your own to test specific scenarios. This is useful for quick and iterative development of extensibility and integration. You can build and test back-end scenarios without running Sitecore.

Important

You must create an account to access and set up Content Hub Nuget feeds before you can open the sample solution.

To use the customer sample solution:

  1. Extract the Sitecore.Commerce.Engine.SDK.*.*.*.ZIP archive, which is included in the Sitecore XC Release Package, as part of the Sitecore.Commerce.WDP package.

    Note

    By default, Microsoft sets the maximum length for a path (file name and its directory route) to 260 characters. As a result, it is important that you keep the folder path and names for the extracted files as short as possible.

  2. From the Official Sitecore Commerce NuGet Feed, download the following package:

    • Sitecore.Commerce.Plugin.Template.*.*.*.nupkg

  3. To install the sample plugin template, open Windows Powershell as an Administrator, and run the following command:

    RequestResponse
    dotnet new -i "<path>\Sitecore.Commerce.Plugin.Template.*.*.*.nupkg"

    For example, dotnet new -i "C:\Sitecore.Commerce.Plugin.Template.*.*.*.nupkg". This installs the Sitecore Commerce Sample Plugin template as shown in the following image.

    List of installed templates
  4. In Visual Studio, open the Customer.Sample.Solution.sln solution.

    This is the Visual Studio solution that you use to develop plugins for the Commerce Engine, and to build and deploy a new instance of the Engine.

  5. In the Connect to slpartners.myget.org dialog box, enter the user name and password for the Stylelabs NuGet feed and click OK.

    StyleLabs Nuget feed credentials
  6. To verify you have a working system, in the Solution Explorer, right-click the Customer.Sample.Solution and click Build Solution.

    If it builds successfully, you are now ready to create your plugin.

Do you have some feedback for us?

If you have suggestions for improving this article,