JSS Commerce part 5 - Implementing catalog pages

In this part I will decribe how we implemented the catalog pages. In part 2 I talked about how we implemented navigation with JSS & commerce. However, this only described how we implemented url navigation, e.g. how a URL is mapped to a commerce catalog item. This time we will focus on implementing a category menu, the category page and the product page.

Read more

JSS Commerce part 1 - Exposing the commerce engine

This is the first article of a multi-part series in which my colleague Joost Meijles and I will share our experiences developing a Sitecore JSS site on top of Sitecore Commerce. In this part I will discuss the first challenge we faced: how to expose the Commerce Engine to JSS.

Read more

Sitecore Commerce 8.2 catalog cache details

For one of our Sitecore Commerce customers it is really important that product updates are processed and reflected on their website as soon as possible. In order to help them we really needed to understand where the product data is cached and how this is invalidated. In this post I will share our findings, which apply to Sitecore Commerce 8.2 & 8.2.1.

Read more

Extending the SXC9 order flow

The default Sitecore eXperience Commerce order flow is quite generic and although it is not documented, it is possible to modify it. In this post I will share how to add a custom order state.

Read more

Extending the SXC9 customer

Multiple times I’ve seen people ask how to extend a SXC9 customer on the sitecore commerce slack channel. Suprisingly, it seems that this is not documented anywhere. We have already done this in our projects at Aviva Solutions, so I decided to write down how we do this. Full credits need to go to my colleague Joost Meijles, who figured this all out.

Read more

Notes on the SXC9 price calculation

Today I needed to sort sellable items based on the listprice, which required me to do a deep dive into the SXC9 price calculation. This turned out to be not that trivial, so here are my notes:

Read more

Dockerizing Sitecore 9 XP0

Sitecore eXperience Commerce 9 is expected to be released in Q1 of 2018. This new version will contain no more COM+ components and is build on .NET core. This means that we should be able to run it on Docker! To get ready for that I wanted to see if I could get the Sitecore 9 xp0 topology running on Docker. Per Manniche Bering, who knows a lot more about Docker than I do, already has Sitecore 9 XM1 running on Docker in this repository. So I wanted to see if I could use his work and add the services needed for xp0. Currently, I got most of it running on docker and will share the repository shortly. For now, I wanted to share some lessons I learned during the process and hopefully safe people some time. As a disclaimer, I am by no means a Docker or infrastructure expert. Any feedback is more than welcome!

Read more

Sitecore Experience Commerce 9

Last week, the Mercury team attended the Sitecore Symposium in Las Vegas. There were a lot of great announcements, not least that Sitecore Experience Commerce 9 is to be launched in Q1 of 2018. Although Sitecore Commerce 8.2.1. was a huge step forward, it is a hybrid between old and new versions, which brought its own complexity.

Read more

How to configure Visual Studio Code as your GIT merge tool

I’m a big fan of Visual Studio Code. It’s fast, extensible and it even runs cross platform. Recently it has gotten build in support for merging. Before, I was using Diffmerge as my merge tool of choice, but I find the 3-way merge view with the remote, base and local files a bit confusing. Visual Studio Code just shows one file and shows the differences inline:

Read more

Why React.JS & Sitecore are the perfect match

Last year we started the development of Mercury, which is a generic E-commerce solution based on Sitecore & Commerce server. Learn more about Mercury here. Over the years we have gained a lot of experience building E-commerce solutions. One of the things we wanted to do better with Mercury was to improve the User Experience, by using more client-side technology and by optimizing our usage of the browsers. This led us to find a client-side technology that would best fit our requirements. These days the amount of JavaScript frameworks is overwhelming, but in the end we went for Facebook’s React. In this article you will learn why.

Read more

A Sitecore Vagrant template

Sitecore (development) environments can be quite complex. Especially when you are using additional software like Sitecore Commerce Server or Coveo. Next to this certain dependencies can change, for example updating certain dependencies in this enviroment.

Read more


The last week I was lucky to be attending the Microsoft Build conference in Redmond. In this post I’ll be sharing my experience. In essence it comes to this: Although I was a bit disappointed by the level of the sessions, I learned a lot about the Windows 8/ Windows Phone 8/ Windows Azure platform and I’m convinced that this ecosystems has great potential and that gives us all the tools we need to build some great apps. (Good job Mr. Ballmer, I already sound like you)

Read more

Debugging dotnet production problems

This post described how you can debug difficult dotnet problems in production environments. To illustrate this I’ll describe how we solved a problem we had with Microsoft Commerce Server in production.

Read more

Filtering Linq to Nhibernate queries with Rhino Security

Rhino Security provides the ability to filter NHibernate queries based on permissions. To do this, an IAuthorizationService interface is provided, that can be used in the following way:

var criteria = DetachedCriteria.For<Company>();
AuthorizationService.AddPermissionsToQuery(currentUser.Value, "/Company/View", criteria);
return criteria.GetExecutableCriteria(Session).List<Company>();

Read more

Convention over configuration

Ruby on rails makes heavily use of the Convention over configuration design paradigm. At the moment it is getting a hot topic in the .NET world too. If you are like me and are lazy and hate doing repetitive work, then you should really check it out, if you are not, you should check it out anyway. In my opinion, when properly applied, convention over configuration can save developers a lot of time and effort.

So what is convention over configuration? One of the best examples can be found in the Fluent Nhibernate project. This is a project that facilitates configuring Nhibernate, without the use of those horrible XML mapping files. One feature of this project is Automapping, which is convention over configuration in its purest form. I will just assume you are familiar with the Nhibernate mapping files, if not, you can read all about in the Nhibernate documentation.

Let’s say you have a domain entity Customer:

public class Customer
    public virtual int Id { get; private set; }
    public virtual string Name { get; set; }
Read more

Xpath queries with Fitnesse webtest

As I wrote earlier, I’m using Fitnesse with the webtest driver to do acceptance based testing. Using webtest, it is really easy to write selenium based acceptance tests in a DSL way. However, the id’s that ASP.NET controls get assigned can get pretty ugly, especially when working with controls like the ASP.NET repeater.

When working with these controls, xpath can be really useful. To use xpath queries for looking up controls with webtest, you have to enclose the command that needs to use xpath with the following statements:

|Set locator lookup|false|

-- The statements that use xpath, for example:

|click|//input[Contains(@id, ‘ageSelector’)]|

|Set locator lookup|true|

By setting the locator lookup to false, it is possible to use xpath queries in stead of the normal lookup strategy used by Webtest (Ids, names or values).

When you are having trouble coming up with these xpath queries, then firebug really is your friend. It is possible to open up the firebug console and using a special command: $x(‘’) you can  then debug your commands:


Read more

Screencasts Todo

Lately I’ve seen more and more screencast announcments pop by in my RSS reader, but unfortunately, the moment I see these, is not the moment I have the time to watch a 30 minute screencast. So I decided to make a list of screencasts I want to see when I have some time at hand.

Jeremy Miller - The joys and pains of a long lived codebase


Eric Evans - on the state of Domain Driven Development


Udi Dahan - on SOA


Greg Young – on DDD


Eric Evans – on DDD: Strategic Design


Eric Evans – on DDD: putting the model to work


Tim McCarthy – on Framework and DDD: Keeping the Model Clean


Dave Astels and Steven Baker – on RSpec and Behavior Driven Development


Read more

Acceptance based testing tools

I really like the idea of having executable specifications. They can be used as requirements documentation and describe what your stakeholder expects from the software. Besides that, it is also useful as an indication of the progress being made by the development team. But what tools are there for automating acceptance tests?


One of the most commonly used tools is Fitnesse. This is a wiki in which the tests can be described as tables. These tests can be described by the stakeholder and be mapped to test drivers that are created by the developers. A test driver is a mapping of the acceptance test to the code that needs to be tested, thus making the test executable.

There also is an extension to Fitnesse called Webtest. This actually is a generic test driver for mapping Fitnesse tests to Selenium scripts. If you are not familiar with Selenium, Selenium is a tool for testing web applications. For example, in c# a Selenium script looks like the following:

ISelenium sel = new DefaultSelenium(
"localhost", 4444, "*firefox", "http://www.google.com");
sel.Type("q", "FitNesse");

Read more

Integrate xUnit tests into your daily Team Build

Doing proper Test Driven Development with the default visual studio test runner (mstest) is like playing Gears of War 2 on an old fashioned tube television, it’s just wrong ;).. There are several alternatives out there like mbUnit and nUnit, but my favorite is xUnit. xUnit is heavily extensible and there is a project called xunitbddextensions, which extends xunit making it possible to do specication based testing (BDD). Using resharper or testdriven.net this makes for an excellent experience when developing in visual studio. xUnit tests can also be integrated into your daily TFS (Microsoft Team Foundation Server) build by using the xUnit build task. However, the details of the testresults are not displayed in the build overview and the results are not used in the reporting functionality of TFS (Like the Quality Indicators report).

Read more

State based Domain Entities (State pattern)

This post is actually just about bringing the state pattern into practice. At my current project, we have some entities that are based on state, which are forcing us to use some not so elegant mechanisms for change their state. I will try to explain this with the following example:

Read more

Unit Tests as documentation

One of the advantages of doing test driven development & unit testing is having the unit tests as documentation of the code. When you read this in the unit testing / TDD books, it is hard to imagine how this would be of use in practice.

Read more

Maintainable code

Lately I have been working with a lot of source code that was developed by other developers and although some of it was of good quality, other code was of… less quality. As a developer I’m always trying to improve the work I deliver, that’s why I read lots of books and blog posts. Because of reading books like Code Complete, The Pragmatic Programmer, Coder to Developer, etc., I think I have grown an understanding about what good code, read maintainable code, looks like. Developing an application just to implement some functionality is one thing, but doing this in a way in which the application being developed is also easy to maintain in the future, is a whole other thing. When code is written without keeping maintainability in mind, the code really gets hard to… maintain. It will be hard to find the implementation of specific functionality, hard to determine the impact of a modification, etcetera. This can even result in code that no developer dares to touch anymore, afraid of causing a domino effect that will break most of the system’s functionality.

For these reasons, every serious developer should be familiar with writing maintainable code. J. Miller has written some excellent posts, which capture the most important aspects about writing maintainable code, without getting too theoretical. His first post is an introduction on writing maintainable code and his second post is a follow-up on orthogonal code.

Read more