Composition - Entities can be extended by adding components to the Components property on the entity. - Components are simply classes that are injected into the entity by a plugin through a Pipeline Block (more on how to create custom plugins in a separate post). - A good thing about this pattern is that it allows us to inject components into an entity without interfering with components injected by other plugins. POLICY Entities can also be extended by adding Policies. A policy is basically a set of rules for an entity. It is a class that defines a set of data that can be used by business processes to determine behavior. E.g. you could define a policy for the cart entity that sets the maximum cart value or the maximum number of line items. In essence, policies are code based configuration settings.
Make xCommerce fit to you
xCommerce fit to
Sitecore Team Leader at SoftServe.
Consultant, who always advice to find the best solution for
client issues. Over 8 years in .net business. Loves to inspire
devs, teams and go through the newest technologies stack.
Between those activities likes dancing, gym and sport in
general. Favorite color: yellow !
xCommerce = Sitecore Experience Commerce, since 9 version
What is the xCommerce?
Many changes comparing to Sitecore Commerce 8, like:
• ASP.NET Core based on
• oData RESTful Web Services
• New UI
• Full lifecycle Order Management, Promotions feature etc.
• Hosting server
• It was launched by Microsoft along with ASP.NET Core. All ASP.NET Core apps
utilize a new MVC framework and the Kestrel web server.
• It is much more faster than IIS
Sitecore Commerce Engine
• This GitHub project has been
archived. Active development has
ore (Part of ASPNET Core Runtime)
#1 By clicking
#By command line
Kestrel - move it, move it
Ok – but how to check it, debug?
• Turn of SSL verification
• Turn of AntiForgeryEnabled on Authoring
• Import Postman
samples .... from
Independent features called:
• Structure of elements
Sequence of calls:
Commerce Api Endpoint (controller) -> Command -> Pipeline -> Block
Sitecore Commerce Engine - The Stuff
We have to know about the clue of this happy time:
But before that...
Fitness Code approaches
A named, versionable and variable set of data that can be used as facts within
behaviors to influence behavioral outcomes. (Source:
In simple understanding we can treat
Policy like a config or setting file in some way.
• Independent features
• Only accepted way to extend Commerce Engine
• Don’t remove default ones just like that ;)
Sitecore Commerce Engine - Plugins
Sitecore Commerce Engine – Controllers and
• You can create your own pipelines and hook
into pipelines defined in other plugin
• Similar to standard Sitecore pipeline
• In SXC9 they are in the code not XML
• Agregate SXC Blocks
• Comparing to XML approach No
„ShowConfig.ASPX” but JSON preview
• In Commerce, there is no config patching
facilities. Instead we can create our custom
plugin and can patch our Blocks through the
Sitecore Commerce Engine - Pipelines
• Equivalent for Sitecore processors
• Chaining calls
• Remember about returning element
Sitecore Commerce Engine - Blocks
OData - OData (Open Data Protocol) is an OASIS standard that defines the best practice
for building and consuming RESTful APIs.
Sitecore Commerce Engine - OData
It’s so super cool till now, but what to do
to use new stuff in Sitecore side ?
Should we know something more?
Well.. Yes, we should.
We cannot use in Storefront references to
.NET Core features from SXC Enginge
Service Proxy acts a middleman between your
engine code and your storefront code, allowing
you to reference the types & controller
endpoints defined in your engine, from your
Sitecore Commerce Proxy
How to use Sitecore Commerce Service Proxy
Build your Engine
with custom plugin
Deploy engine or
run on port 5000
Add Service Proxy
project to your solution
In VS2017 expand
For CommerceOps & CommerceShops right click
on them and select Update OData Connected
Service (This will hit the Metadata data endpoint of the engine
and rebuild the generated code files for each)
Reference the updated ServiceProxy project in your
Storefront project and start to use your custom
Some extra feature which came in SXC 9.0.2
IF we have time for this now, let’s make some