Having recently onboarded a developer onto a Sitecore project that utilizes Sitecore Commerce Connect, I thought it would be useful to share some that knowledge with the community. If you too find yourself starting a project that uses Commerce Connect, hopefully you’ll find this information helpful and allow you to hit the ground running quickly.
Sitecore Commerce Connect – What is it exactly?
Sitecore Commerce Connect is an e-commerce framework designed to integrate Sitecore with different external commerce systems and, at the same time, incorporate customer engagement functionality provided in the Sitecore Customer Engagement Platform.
It is supposed to act as an abstraction layer between your Sitecore implementation and the External Commerce System. The Commerce Connect Core by providing services and models to help implement basic commerce features such as cart, pricing, order, customer and catalog management.
Ideally when you implement your solution to use this layer, it should not know anything about the External Commerce System (ECS) you are integrating Commerce Connect with. This will help to build a robust, structured, and maintainable platform while also keeping the frontend/Sitecore components separate from the External Commerce System, so that if you decide you need to replace the underlaying commerce engine in the future it should be much easier rather than having Sitecore tightly coupled with the underlying engine.
Where to start
I have to say the Sitecore documentation for Commerce Connect is really good. It a good starting place to help you get up-to-speed and wrap your head around the Core Framework. So check out the developer reference guide and familiarize yourself with the abstract service layers and supporting data models and entities that are available OOTB. These are broken into distinct functional areas typical of what you will find in a commerce application.
- Cart Service Layer – provides various methods for managing and interacting with the shopping cart in your ECS: LoadCart, MergeCart, UpdateCart, DeleteCart etc.
- Pricing Service Layer – provides various methods you might want to interact with in your ECS to retrieve pricing for products.
- Order Service Layer – this provides various methods to submit or retrive orders and other supporting methods relating to orders in your ECS.
- Catalog Service Layer – allows you to manage the catalog provides various methods you might want to interact with in your ECS relating to pricing.
- Globalization Service Layer
- Inventory Service Layer – provides methods allowing you to retrieve inventory / stock information from an ECS.
- Customer Service Layer – provides methods for managing customers and users.
- Payment Service Layer – provider methods for getting various payment options an ECS might provide.
- Shipping Service Layer – allows you to retrieve shipping options from your ECS
- Wishlist Service Layer – allows you to interact with shopping wishlists.
- Product Synchronization Service Layer – allows you to synchronize products between Sitecore and you ECS.
Custom Commerce Connector
While Sitecore provides connectors for Sitecore Commerce Server and MS Dynamics it does not include connectors for other ECS. These you must build this yourself to integrate Commerce Connect to work with your ECS. This is where you will spend a good portion of your time developing the integration between your Storefront in Sitecore and your ECS.
Nuts & Bolts
The core framework contains a list of abstract service layers based on common commerce features. These service layers are kept generic allowing you to target various ECS.
Each service layer consists of:
- a customizable domain model.
- an Api exposed as a service layer with methods accepting customizable requests objects and returning customizable results objects.
- pipelines – each service layer executes a pipeline that can call one or more pipelines.
When designing your integration with your ECS you should use the appropriate Commerce Connect service layer API instead of accessing the ECS API’s directly. This ensures your solution is more maintainable and provides a very defined pattern for integrating with your ECS. Using the standard Commerce Connect pattern enables you to replace the ECS with minimal effort. Obviously features and customizations that were unique to your old ECS would require additional effort to replace and integrate with any new ECS.
Extending Commerce Connect
But Commerce Connect is very generic and does not provide all the services I require or match all the data I need to pass between my storefront and my ECS! I hear you say. Thankfully the Commerce connect framework has been designed with this in mind and is extremely extensible. So rather that making direct calls to your chosen ECS api’s you should extend the Commerce Connect.
- Commerce Connect
- Commerce Connect Developers Reference
- Commerce Connect Introduction
- Commerce Connect StarterKit – The starterkit is a useful project showing you how to create a custom connector for Commerce Connect to integrate nopCommerce as the ECS.