AssureX is recognised as a Silver Sitecore Partner Find out more         
Plugin
Commerce Development Get It Right Quick Tips Sitecore

First Step | Commerce Development | Create a Custom Plugin

In my last post, I have described the steps to set up the Sitecore Commerce development environment. In this post, I will describe how to create a custom plugin in Sitecore Commerce. I was working on version 9.3 but these steps should work with all versions of 9 series.

Sitecore Commerce provides an extensible framework which can be extended using plugins. A plugin is an independently publishable extension to the Sitecore Commerce Engine. Generally, you will find the following contained in a plugin and are used to extend the platform.

  • Entities
  • Components
  • Entity Views
  • Pipeline
  • Policies etc.

You can extend the platform or add more features using the plugins. Let’s get started and look into the steps to create a new plugin in Sitecore Commerce 9.3. If you have already set up your commerce development environment, please skip to step 2

Step 1 – Setup developer environment

  1. Create a developer environment for Sitecore Commerce to run the engine from Visual Studio, can be either VS 2017 or 2019. Follow this blog post to Setup development environment for Sitecore Commerce 9.3 Engine

Step 2 – Install Visual Studio plugin Extension

  1. Go to the solution root folder or SDK folder and run the Sitecore.Commerce.Plugin.vsix file. Close the Visual Studio solution if open.
  2. This should install the extension on selected Visual Studio Version

Step 3 – Create a plugin

  1. Open your solution. Create a Feature solution folder, just to follow Helix best practice. Right-click solution folder to create a new project
  2. Search Sitecore.Commerce.Plugin. Select project type and click next.
  3. Give the project name, location and select .Net Framework 4.7.1. Create a Project.
  4. Sample Folder and Files for Commands, Components, Controller etc shall be added.
  5. Update the Sitecore Commerce Core from 5.0.0 to 5.0.4


  6. Build the project.

Step 4 – Reference project and run engine

  1. Add a Plugin project reference to your Commerce.Engine Project
  2. Run the Engine. You should be able to see the newly created plugin is now registered in Engine.

This is the first step towards the journey of extending Sitecore Commerce

We intentionally didn’t add any code to this plugin to keep this simple.

In the next blog, we will cover the anatomy of the newly created plugin and show how to inject this plugin into Commerce Pipelines and execute some custom code.

Hope you enjoyed this post. Stay tuned.

Did you find this useful? If so, please share with your connections.

Leave a Reply