Sitecore Commerce supports integration to the third-part system and customization and extension to the OOTB entities. This can be achieved by custom plugins.
If you are migrating your code from XC 9.x version to XC 10 you will have to update the code to newest API’s provided with XC. Following is the list of breaking changes if migrating from older versions or good to know if you are starting with the new XC 10 solution.
Wrappers to PipelineBlock
Commerce Engine uses pipeline framework to support extensibility. Pipelines act as a containers for business logic. Commerce pipeline consists of a block which has a detailed business logic.
With Sitecore 10 PipelineBlock are now wrapped with AsyncPipeline and SyncPipeline. So if you have your code using PipelineBlock it should be using Run method to execute the block you may have injected to pipeline.
If block needs to be executed Asynchronously use AsyncPipelineBlock. Also the method name changes to RunAsync()
If block needs to be executed Synchronously use SyncPipelineBlock. The method name used to execute block is Run()
ConfigureServiceApiBlock also now uses SyncPipelineBlock
2. IPipeline RunAsync() method
IPipeline interface method is changed from Run to RunAsync() which now makes sense as the method is asynchronous operation.
So where are the changes you might need to make, some of the pipelines that is used frequently and need change are listed below-
Any custom pipeline and list goes on…
These are few of the breaking changes. There are more and I shall keep updating.
Business Tools is extensible using pluggable framework and can extend a UI using Entity Views. Although Business Tools offers a rich set of controls you might want to create your own custom control for the best business experience.
For this you need to first setup the development environment for business tools. Once the environment is setup you should be ready to develop custom control/customize the business tools.
Instance of Commerce Engine deployed in development environment
Are you wondering why this error occurred while registering user?
You may come across this error when the engine is trying to create a customer in Commerce and the domain you have created for Storefront is not available in Commerce. The customer in commerce are mapped to the domain and if the domain is not found or matched with what is configured in Storefront this error will come.
So how to resolve this error-
Lets say your Storefront is mapped to use the default environment i.e. HabitatShops.
Follow steps below to make this work-
Open PlugIn.Habitat.CommerceAuthoring-1.0.0.json and find the CustomerPropertiesPolicy
You may see the list of Domains default been Storefront, extranet and CommerceUsers
Add the domain you have configured in your storefront in this list e.g.:- HabitatStorefront
Add the same domain to PlugIn.Habitat.CommerceShops-1.0.0.json
Ensure the domain is created and mapped in the Storefront correctly
Bootstrap Habitat Environment using Postman and now you should see the domain in the list whilst creating a customer
You should now able to see the domain in the list whilst creating a customer in business tool
Should also allow to create a customer with the new domain-
Sitecore Storefront can have multiple catalogs, but only one catalog can be used to each Storefront.
At times whilst development you might have to switch between the Authoring site and Visual Studio Commerce Engine Solution for debugging. I have seen sometimes the Catalog for the Storefront is reset during the switch which results in error – No catalog data available.
This message is shown on the menu as seen in the screenshot-
Login to Sitecore Client and follow these steps-
Navigate to following location in Content Editor- /sitecore/content/Sitecore/Storefront/Home/Catalogs
If none of the Catalog is selected, please select the Catalog and Save. In this case Habitat_Master
Should now display the menu as the Catalog details are now setup
You also might need to consider checking Catalog Configuration here – /sitecore/content/Sitecore/Storefront/Settings/Commerce/Catalog Configuration
Environments in Sitecore XC are used to control the configuration policies that defines behavior. Define a Commerce environment in the environment configuration JSON file. JSON file contains information specific to Commerce Engine policies that needs to be implemented for specific environment for example Habitat Authoring.
In this article will show how to configure the policy in a specific environment JSON file and access the policy that affects the behavior based on the settings.
First check the default environment. Open Sitecore.Commerce.Engine.Connect.config and see