allBlogsList

Product Synchronization Provider

Sitecore Commerce Connect 8.0 comes with an out of the box product synchronization provider. The OOB provider is in the class “Sitecore.Commerce.Services.Products.ProductSynchronizationProvider”.

I had to extend the provider to add a license check, add logging and make some more customizations related to external commerce system. Before you start the process of synching the products, you will have to pause the indexes. The mistake I committed initially was that I paused all the indexes available in the ContentSearch. So, it took a longer time for the sync process to complete. After discussing with Sitecore, I found out that there is a setting in commerce config files called ProductSynchronization.ProductIndexes. It has the Sitecore Master Index and Commerce Products Master Index specified by default. All I had to do was read the config for the ProductSynchronization.ProductIndexes and pause it. Then start the sync process and after the sync process is over, clear the cache and then resume the indexes from the same config setting ProductSynchronization.ProductIndexes.

Now you may wonder how the web index is rebuilt. Once the product sync is completed, you will have to publish the product repository. Depending on the publish strategy (smart publish or republish everything), the commerce web index and Sitecore web index will be completely rebuilt or partially rebuilt based on the number of items updated. The web indexes are built based on “OnPublishEnd” strategy.