Sitecore Commerce 9.x : Setting Up your Development Enviornment

SItecore Experience Commerce Development

After installing the Sitecore Experience Commerce by default we have a storefront with Commerce Engine which have a few plugins that is used in storefront site. Sitecore commerce Engine by default run on the Commerce Authoring site with https on port 5000.

In the Development when we need to create some plugin and extend the existing plugin we need to debug the engine as well. Developers can do so by using the Sitecore Commerce Engine SDK provided by the Sitecore by default in the Sitecore Experience Commerce installation package. This post assumes that you have already setup the storefront site. So, lets dig into it.

Step 1: Extract the Commerce Engine SDK

    1. Extract the Sitecore.Commerce.Engine.SDK.X.X.X.zip to a folder.

Step 2: Preparing the  EDevelopmentnviornment

All the Commerce Engine based sites use https for the binding. So, in that scenarios we need to run our solution on https binding. Sitecore by default provides some scripts to export the certificates and use them in development.

Generate the SSL Certificates for the Development
        1. Go to the Scripts folder in the Sitecore.Commerce.Engine.SDK.*.*.*.
        2. Open the powershell in the Administrator Mode and execute the New-                  DevelopmentCertificate.ps1. This script will create the two new files(localhost.cer, localhost.pfx) in     your Engine SDK wwwroot folder.
Setting Up the Certificate for the Authentication

Certificates are required for authenticate the request from trusted source. You need to follow teh below steps to configure this.

  1. Go to Commerce_Authoring website > wwwroot > config.json file.
  2. Find the thumbprint element from the Json file and copy it.
  3. Go to the Sitecore.Commerce.Engine project. Open the wwwroot > config.json file paste the above copied value and save the file.
Start the Solution debugging
  1. Stop the Commerce_Authoring site in the IIS running on the port 5000.
  2. Open the SDK solution in the Visual Studio.
  3. Change the debug profile to the Engine from the IIS Express
  4. Run the application. Now you can put the breakpoint in the current sdk code even you can see the console application which show the current pipelines and command running behind the scenes.

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *