Update Data Templates not working in Sitecore Commerce

In my current Sitecore Commerce project we got an issue where the updates of templates in Storefront from Commerce Engine stopped working. There were no errors in logs and when we run the operation it finishes successfully but did not get the latest updates from Commerce Engine to Sitecore.
sitecore-update-data-templates

To give you more context we have a custom component added to Sellable Item commerce entity.
sitecore-custom-component

We double checked few things:
- Sellable Item entity is getting saved properly in Sitecore Commerce databases with custom components data.
sitecore-sellable-item-json

- In Business app custom component data add/edit working properly.
sitecore-business-app-edit-form

All of the above was working properly. Then we decided to find out the API call that Sitecore uses to perform Update Data Templates operation. Sitecore has implemented a custom Data Provider named “CatalogDataProvider” to achieve integration between Sitecore and Commerce Engine. Catalog data provider has lots of API calls those are handled by the “Sitecore.Commerce.Plugin.Catalog” at Sitecore Commerce engine side.
To get the Sellable Item information Catalog data provider uses the “GetSellableItemConnect” API call. We tried this call in Postman and found that our custom components were there is the response but without the information we stored with them.
sitecire-getsellableitemconnect
sitecore-missing-component-details

You can see that component Id in response is same as component id we checked in the json stored in database. So something was happening at serialization time where the data from the database is lost while sending the response.
By looking at our component classe again we found that we missed the “public” access modifier with our component class and that was the reason that Commerce Engine was not able to serialize custom implementation and only adding the base component class details in response.
sitecore-custom-component-correction

And here is the updated response from API
sitecire-getsellableitemconnect
sitecore-correct-component-details

Conclusion:
Always make your custom components classes as “public” in Commerce engine.

Share thisEmail this to someonePrint this pageTweet about this on Twitter0Share on Facebook0Share on Google+0Share on TumblrShare on LinkedIn0
1 vote

Leave a Reply

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


five + = 14

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>