404 in (Sitecore) Commerce Server Manager Profile Definitions

Recently I ran into a problem with our Commerce Server installation on our internal and external staging/UAT environments, when we tried to verify the property on the User Object definition we were presented with a "The webpage cannot be found" message. Turns out Commerce Server installs a "widgets" virtual directory in your root application. If you don't have a root application or have it switched off you can follow the instruction here substituting the new Commerce Server path (C:\Program Files (x86)\Commerce Server 11\Widgets) for the old Microsoft one. If you want to specify a different location for the widget directory (our staging instance is also running a staging instance of Sharepoint in the default application) you can follow the instructions here to get Commerce Server to look elsewhere. Unfortunately you need to do this on each definition and as a note, don't include the http:// in your <server name> value.

Commerce Server - Disabling cart engagement analytics plans

As it happens I'm currently working on a Commerce Server implementation that uses cart functionality without online purchasing functionality. As such, the build in engagement plans didn't make sense so I didn't add them to the site. The problem came in the form of an error when adding items to the cart:

{"Errors":["AddCartLine: Engagement automation plan with name Abandoned Carts cannot be found."],"HasErrors":true,"Success":false,"ContentEncoding":null,"ContentType":null,"Data":null,"JsonRequestBehavior":1,"MaxJsonLength":null,"RecursionLimit":null}

After search around for the pipeline that was adding this, I found the Sitecore.Commerce.Connect.CommerceServer.Orders.Pipelines.AddLinesToCart processor that has a "DisableEap" property, setting this to True resolved the error.

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
        <processor patch:before="processor[@type='Sitecore.Commerce.Pipelines.Carts.Common.RunSaveCart, Sitecore.Commerce']" type="Sitecore.Commerce.Connect.CommerceServer.Orders.Pipelines.AddLinesToCart, Sitecore.Commerce.Connect.CommerceServer" >
          <param desc="Rollup">True</param>
          <param ref="eaPlanProvider"/>
          <param ref="eaStateCartRepository"/>
          <param desc="DisableEap">True</param>

Microsoft.CommerceServer.Internal.ContentListHelper - An attempt was made to load a program with an incorrect format

Whilst Microsoft Commerce Server has been around for a while, it's rebranding as Sitecore Commerce (Powered by Commerce Server) is a fairly recent move. As such, resources are a limited and troubleshooting issues is rather difficult. When developing my solution, I found that as soon as I added a reference to any commerce server dll (CommerceServer.Core.x.dll) I was having a problem with an error "Microsoft.CommerceServer.Internal.ContentListHelper - An attempt was made to load a program with an incorrect format", somehow it was copying the CommerceServer.Internal.ContentListHelper.dll to my application, even though I didn't have a reference to it. Deleting the dll from the bin directory fixed the issue and forced the application to use the 64 bit version in the GAC. However, every time I rebuilt the app, the dll would appear again. Step number three detailed over here did it for me.

Challenges with utilising Sitecore Search and Lucene in 6.6

The introduction of the "new" Sitecore Search library in Sitecore 6.5 was a big step forwards for Sitecore, unfortunately, Sitecore 7 made even bigger steps leaving those on version 6.5 - 6.6 with some challenging scenarios to deal with. This has come up a bit lately in a new application I am supporting. This website is very data heavy, and previously caluclations and data retrieval were done in memory and traversed a very complex tree structure. To optimise the application we began inserting the data into a flat structure in the lucene index. This allowed us to make a since call to retrieve all the complex data we needed to render certain screen. This greatly reduced resource utilisation and page load time, but introduced some new issues we struggled to deal with.

Read more

Using the Sitecore Wildcard Module

Ever had an SEO person tell you to remove query string parameters from your URL and use mod rewrite to create friendly URLs? It does little good to tell them that your site runs on IIS not Apache but at least there is a Sitecore Module that helps you replace tokens in your URLs with values to help you resolve items.

The first step is to install the module from the Sitecore Marketplace. The requirements state a Sitecore version between 6.4 and 6.5, but I have successfully used it in 6.6 and 7.5 installations. Using it in 7.5 with xDB will require some modifications due to changes in the rules engine. Thankfully someone has already documented them here. The same user has also released an updated version of the Wildcard Module, but I'm yet to give it a shot.

Once you've got the module installed you can attempt to following the "Getting Started" documentation. It's confusing, and is a light on the individual steps required to configure your items, generate URLs and retrieve the token values.

Read more

Getting pa11y running on windows

Over the past day I've gone through the process of getting nodejs, npm and an automated accessibility tool called pa11y up and running on my local machine as a test for integrating it into out build process and overall project dashboard.

Pa11y is an automated tool where a set of tests from the WCAG 2.0 can be executed over the command line, through web services or a dashboard. So far I've managed to get the command line running and thought I would record all the steps whilst they're fresh in my mind. So here goes...

Read more

Holiday Baking

Over Christmas I had grand plans to make decorated cookies for all my coworkers. Unfortunately when I was working on this idea in my head I didn't take into consideration the 50 odd people I worked with and the fact that I couldn't just give them one cookie each. I ended up making snickerdoodles and chocolate snowball cookies and made some decorated sugar cookies for my Aunty instead.


With Easter coming up I once again decided to break out my new PME supertips and made some egg shaped bunny cookies. I try to keep my designs simple as I am always having difficulty with the consistancy of my icing. If I am going to be honest about it, I dislike having to make two batches (one for flooding and one for details/outlining) so it's always on the runny side.

The highlight of Sitecore 8

I've finally had a change to play around with Sitecore 8 and MVC and one of the first things I noticed...new icons! I'm sure that's what my partner manager meant when he was talking about new features...

Programatically updating Layout details on a Sitecore item

Today I've run into a bit of a problem trying to programatically update the datasource of a rendering added to a Sitecore item. Essentially when I retrieved the LayoutDefinition details from the layout field it was sometimes coming back empty and sometimes not parsing the values correctly. Not to mention the Datasource property was always empty and the LayoutDefinition.ToXml() was returning completely different XML. Interestingly enough my search lead me to this question on StackOverflow from 2011 which relates to Sitecore 6.4.1 (I'm using 7.5). Pretty much the answer was to change:


Configuring SMTP Settings in Web Forms for Marketers

Problem: The SMTP host settings for sending emails using the standard "Send Email Message" save action are configured on the action itself in /sitecore/system/Modules/Web Forms for Marketers/Settings/Actions/Save Actions/Send Email Message. So what if you have a different mail server for different environments? It turns out you can override these settings on a global level by adding another pipeline before the SendEmailMessage.

Read more

So it turns out you can't cache using VaryByParm and dynamic parameters

This was news to me. I had been caching by adding

[control].Parameters = string.Concat("ItemId=", Sitecore.Context.Item.ID);

We recently started another round of performance testing on my current project and we found that performance was dismal compared to previous testing. The stats page was indicating that content was being retrieved from the cache, but profiling and debug messages indicated this wasn't the case.

Read more

And chaos ensues

Whilst previous posts indicated I would be back to my regularly scheduled boring Sitecore posts I actually went on holidays for a month visiting my sister in Belgium (near Vervier), London, Paris and Iran (Tehran, Shiraz, Yazd and Esfahan). Surprisingly my inability to interpret 24 hour time didn't bite me in the arse and I had a wonderful trip. The highlights? Seeing my sister and my rgeous three month old niece, London and Esfahan. Unfortunately Umbraco decided it didn't want to display it's login page and any intention to blog went by the wayside.


Adding custom styles to the "Apply CSS Class" dropdown in the Sitecore Rich Text Editor

Adding options to the "Apply CSS Class" dropdown is a little more complicated than most RTE customisations due to the integration of the Telerik editor in Sitecore. Whilst adding options is reasonably straight forward, it conflicts with other functionality in Sitecore like the ability to have different editor profiles and multi-site solutions. So here's how you can customise styles for different profiles and sites.

Read more

Using Fast Queries and Attribute Mapping in Glass Mapper

Sometimes the unthinkable happens and your client has 129 filters for a table and these items are stored in Sitecore. This question on Stack Overflow helped me with the solution (i.e. how to use fast queries with Glass Mapper) but I was having the same query parser exception as the other commenter. After a bit of digging through the source code I found the solution, use {escapedPath} rather than {path}. Problem solved, continue to add unnecessary data to a table.

It's Back!

I've been having a problem lately with empty nodes in Umbraco - unfortunately I did a full site publish at one stage and published a bunch of empty posts I couldn't delete. I tried to fix this by updating Umbraco and:

  1. Changed my current Umbraco instance to a new one.
  2. Broke the current development copy of my website.
  3. Couldn't get any copy of my website working.

Fortunately I've managed to get things running again, haven't lost any data, and have found that if I move untitled nodes they disappear. This means I'll be back to the regularly scheduled Sitecore dribble soon enough.

SubLayout Caching in Sitecore

I always manage to forget the different options for caching sublayouts in Sitecore. Today when trying to figure out if I should vary my cache by user or login on a sublayout that displays the current users first name (user by the way) I found a very handy table on the Sitecore Basics site.

Lifestyle bindings for .NET providers in Sitecore with Castle Windsor

This has to be the most boring post title ever, if you made it to the post summary I'm surprised. When I first set up our delivery servers I was finding random entries in the log files (which I stupidly haven't saved) saying that the role provider was throwing an error. The solution to this was a simple one, Sitecore was calling the role provider on the delivery server where a server Request didn't exist.

Read more

Microsoft ASP.NET Identity...More .NET memberships

Over the weekend my employer ran a 24-hour "hackathon" where we developed a product that utilised the FitBit API and related to metal health. We managed to scrape together an all female team and built a "mood tracker" that combines sleep and activity data from FitBit with your current mood - you can check it out at moodboardapp.com. I decided to use MVC5 and Microsoft ASP.NET Identity for this and it proved to be very interesting. I don't know if it was the best choice when we only had 24 hours to get it working, but we did eventually get it ing.

Read more

Programmatically resolving conditional rendering rules

Utilising Sitecore conditional renderings is an easy way to personalise and serve relevant content to users based on a number of factors. What makes this even better in Sitecore is that the rules engine is very extensible and it's quite easy to create your own custom rules, conditions and actions. Things get a little tricky however when you want to define rules on a site wide component like your navigation, or in my case, notifications.

Read more

SubLayout Parameters and Glass

SubLayout parameters are a convenient way to add display and rendering information to a presentation component in Sitecore. Creating a template for the parameters makes it easier for content editors to supply the correct information. You can also utilise Glass Mapper to access the parameters rather than parsing the name/value collection from the base Sitecore information.

Read more