Using Sitecore Commerce Connect Core to sync External System data ?
Whenever I have a requirement to sync the data to Sitecore, I always come across the Sitecore Commerce Connect Product synchronization feature. So far I haven’t had opportunity to analyze whether it is a right choice for synchronization. Also I have not found any good reference on this.
Recently I had an opportunity to analyze Sitecore Commerce Connect Core, here in this blog post am sharing my experience, this blog will help you to understand the following
- How to quick start with Commerce Connect Core
- Helps you to decide whether you should consider this feature or not.
Introduction
To implement Commerce Connect feature, Sitecore recommends to use Sitecore Commerce Core package (Sitecore Commerce Connect Core xx.x.xx) only. We don’t need to install complete Sitecore Commerce Feature.
From Sitecore 9.x onward, Sitecore Commerce Connect was bundled with Sitecore Experience Commerce package, there is no additional license cost, but Sitecore should allow (you need to connect with Sitecore to get updated license) to use Commerce Connect core feature independently without Commerce feature.
How to get started ?
You can download Sitecore Commerce from Sitecore Downloads. I had downloaded the Sitecore Commerce 91 initial release for this evaluation.
Uploaded the Sitecore Commerce Connect Core xx.x.xx package to the local Sitecore instance.
I had gone through the Sitecore Commerce Connect documentation multiple times to get an idea where and how to start, the below are the steps.
Steps to Start
- Uploading the Sitecore Commerce Connect Core package (only).
- Create the Product Repository from Branch Templates (right click from Home node), more details you can find in documentation
- Check if you are able to see the Ribbon Menu items on Selecting Product Repository (like below), where you can see ‘Synchronize all products’, ‘Synchronize artifacts’ etc.,
- Enable the below Sitecore Commerce config files to Commerce Connect Core package working
- Sitecore.Commerce.Products.config
- Sitecore.Commerce.Products.Solr.DefaultIndexConfiguration.config
- Sitecore.Commerce.Products.Solr.Index.Master.config
- Sitecore.Commerce.Products.Solr.Index.Web.config
- Click ‘Synchronize artifacts’ button in the ribbon and check the Sitecore logs whether you are able to see the below logs. If you are able to see the logs, then configuration is right, you can get started.
By analyzing the below dlls, you will get to know what else you can do with Commerce Connect Core.
- Sitecore.Commerce.Connect.Core.dll
The below are the high level summary of what Sitecore Commerce Connect core dll contains.
How to use Commerce Connect to Sync Contents to Sitecore?
The below diagram depict, how to use the Sitecore Commerce Connect. We need to build Custom connector on top of the Commerce Connector, by overriding all the required class.
When we override the Sitecore Commerce Class to synchronize, we should configure to use the custom connector instead of default Sitecore processor. So we need to custom code to sync data, there is no OOTB feature available to sync the content.
When Sitecore calls the default ‘RunSynchronizeManufacturers’ process method, it will call our custom connector methods, the logic written in the custom connector will get executed.
I tried to de-compile the Sitecore Commerce Core dll and found many adapter classes are present, we can override these class objects as needed.
For example : If you want to synchronize the manufacturers, you should inherit and override the ‘RunSynchronizeManufacturers’ class and implement the custom code what is required.
Once the class is overwritten, update the config file ‘App_Config\Include\Sitecore.Commerce.Products.config’ to include the ‘CustomRunSynchronizeManufacturers’ custom processor (you can do it better way, using patch approach). Also comment the default ‘RunSynchronizeManufacturer’.
Nop Commerce with Sitecore Commerce connect ?
Many Sitecore documentation will point you to Commerce Connect Starter Kit. I was clueless when I start with the starter kit, analyzed what it is and captured as a diagram below. I found this will be a very good example if you are going to use the all Sitecore Experience Commerce feature.
Conclusion
If your answer is ‘Yes’ for all the below question, then you should consider using the Sitecore Commerce Connect otherwise not.
- Are you going to use Commerce features like Cart, Wishlist, Orders, Inventory, Payments, Customer, etc., ?
- Are you planning to use Sitecore + Sitecore Commerce ?
- In your overall architecture, is Sitecore plays the central role as CMS & MVC based Frontend ?
- Do you want to custom build the entire data synchronization solution ?
- Are you looking for solution which is having less learning curve ?
Alternative Options:
- If you looking for an alternative framework provided by Sitecore, then you should consider the Data Exchange Framework
- If you want to custom build the data synchronization solution, you can do that without binding to any framework like DEF or Sitecore Commerce Connect. Provided you take care of pre and post data processing needs.
If you have any comments or thoughts, feel free to add here.