Sitecore Commerce Series: Exploring Reference Storefront

Storefront Home Page

Sitecore Commerce 8.2.1 comes along with a sample solution which is supposed to be used as a reference:
Sitecore Reference Storefront Powered by Sitecore Commerce

The last update package (Sitecore.Reference.Storefront.Powered.by.SitecoreCommerce.10.2.65.zip) which is part of the Commerce installation package contains the sample web store
Once you install the update package and the two Sitecore packages with the images:

  • Adventure Works Images.zip
  • Sitecore.Commerce.Habitat.Images-1.0.0.zip

you will have the Storefront shop installed on your Sitecore instance.

The source code of the Storefront implementation is available on GitHub: https://github.com/Sitecore/Reference-Storefront
When you are cloning the repository make sure you are using the appropriate release for your Sitecore Commerce version:
https://github.com/Sitecore/Reference-Storefront/releases

You can find two different solution files in the repository:

  • Commerce Engine Storefront Solution

    Commerce.Engine.Storefront.sln – containing the Storefront shop implementation

  • Commerce Server Storefront Solution

    Commerce.Server.Storefront.sln – containing the Storefront shop implementation plus 2 TDS Projects containing
    the definition and content items, part of the Storefront website. If you have installed the Storefront update package you already
    have these items

In this blogpost I will use the first solution: Commerce.Engine.Storefront.sln

The solution consists of 3 different projects:

  1. Commerce Storefront Project

    Commerce.Storefront

    This is the main web project which contains the controllers used for the site components. Other interesting parts of it are the Managers related to the web store features like OrderManager, PricingManager, ShippingManager and others. They give really good examples of the Commerce API which unfortunately is not so well documented.

  2. Common

    While Commerce.Storefront stores the controllers, this project contains mostly the models constructed by the controllers.
    There are some utils helpers, extension methods and other more common managers in the Common project as well.

  3. CommonSettings

    The common settings project, which is a web project as well, focuses on the front-end of the application. It contains the View files, the CSS and JavaScript files.

The Commerce Storefront solution is not structured in the best possible way (even the file structure is misleading) but it gives a really good overview for
the features for Commerce Engine and Commerce Connect module . All the available code examples help developers to get real idea of Sitecore Commerce and its API.
A new version of the Storefront solution will be released together with Sitecore Commerce 9.

Sitecore Commerce Series: Installing Sitecore Commerce 8.2.1

azman

Installing Sitecore Commerce 8.2.1 is not so straight forward and the module isn`t supported by SIM
You can find the documentation here: Sitecore Commerce 8.2.1 Update 2 Deployment Guide but there are many tricky parts and if you don`t follow the instructions strictly or you want to customize your commerce instance you will have troubles. And unfortunately Sitecore Commerce errors are not so descriptive.

In this post I will list the gotchas that I had during the installation process.

  1. Prefix the application pool identity with “.\”

    You must prefix the application pool identity with “.\” for the application pools of the Sitecore instance, Commerce Authoring and Commerce Server services.
    You might not notice this note in the instructions but it is really important!

  2. Exception after installing Sitecore.Reference.Storefront.Powered.by.SitecoreCommerce.10.2.65.update package

    After installing the last update package called Sitecore.Reference.Storefront.Powered.by.SitecoreCommerce.10.2.65.update you will get an exception.
    This is pretty normal as noted in the documentation and most probably you will have to reinstall the package after you update the Commerce Server Profile Schema

  3. The profile web service must have Windows Authentication enabled

    The web service called CFSolutionStorefrontsite_ProfilesWebService (one of the commerce services) must have Windows Authentication enabled.
    Unfortunately this small requirement is not mentioned in the documentation.
    Windows Authentication

  4. If you receive any errors during or after the installation process you should check:

    • If the Commerce Services are up and running:

      • Open http://localhost:1004/CFSolutionStorefrontsite_ProfilesWebService/ProfilesWebService.asmx and confirm it`s up
      • Open http://localhost:1004/CFSolutionStorefrontSite_CatalogWebService/CatalogWebService.asmx and confirm it`s up
    • If the Commerce Authoring service is up and running:

      • Open http://localhost:5000/api/$metadata and verify that you can retrieve metadata
    • If the user CSFndRuntimeUser has Administration role for the commerce services authorization stores:

      • Run azman.msc and open the authorization store xml file located at: “C:\inetpub\wwwroot\CSServices\CFSolutionStorefrontsite_CatalogWebService\CatalogAuthorizationStore.xml”. Verify the user CSFndRuntimeUser has administration privileges
      • Run azman.msc and open the authorization store xml file located at: “C:\inetpub\wwwroot\CSServices\CFSolutionStorefrontsite_ProfilesWebService\ProfilesAuthorizationStore.xml”. Verify the user CSFndRuntimeUser has administration privileges

      azman

  5. Just before you start installing Sitecore Commerce 8.2.1 watch the installation video: