Wednesday, September 16, 2020

Sitecore Experience Commerce (Entity Composer) - Key consideration.

Entity Composer is a way to extend the Sitecore entities from the UI Like we can create additional fields and attached those fields to the entities.

If you want to extend any of the Sitecore entities, you would need to add those properties.

For sellable items, there are two options either you can generate those field through the code-first approach, here is a link or you have to define those field in composer template.

I most of the time prefer to use Entity Composer to extend the Sitecore XC entities and it basically depends on the requirement if you don't know the field structure before processing the import, It's recommended to create the filed schema dynamically.

These are the high-level entities.

  1.  Sitecore.Commerce.Plugin.Catalog.SellableItem
  2.  Sitecore.Commerce.Plugin.Catalog.Catalog
  3.  Sitecore.Commerce.Plugin.Catalog.Category
  4.  Sitecore.Commerce.Plugin.Promotions.PromotionBook
  5.  Sitecore.Commerce.Plugin.Promotions.Promotion
  6.  Sitecore.Commerce.Plugin.Pricing.PriceBook
  7.  Sitecore.Commerce.Plugin.Pricing.PriceCard
  8.  Sitecore.Commerce.Plugin.Customers.Customer
  9.  Sitecore.Commerce.Plugin.Orders.Order

Here are the simple steps and best practices.

Go to the Composer template -



1. Naming convention -  I usually prefer the naming Pascal cashing and giving the entity name considering the OOTB naming structure which is 

Sitecore.Commerce.EntityViews.EntityView - OOTB

CompanyName.Custom.Type

CompanyName.Custom,Color

CompanyName.Custom,AditionalProductDetails

Give it the same Display name and just add the proper spacing.

Make sure you choose your name carefully as there is no any option to update the entity name. which is true it's like a primary identifier.

Second point is the view name should be more relevant, As the contact editor will use that field to get the understanding.


Field property - Remove space from the Name and add meaningful display name



Add meaning full tag name  


Assoicate this entity composer with existing entiries.


Now, Here we have associated this custom entity with existing entities, that's it now we can add those values to existing entities.

Order View


Customer VIew -

Price Book


 

No comments:

Post a Comment