Extending Umbraco uCommerce with custom Service

First of all. Umbraco is great .NET open source CMS. uCommerce is an e-commerce package for Umbraco (even though they have scary foreign-language banner on the main page right now, they are pretty much English-speakers. Honest!)

Of course there are plenty of articles on how to add own functionality to uCommerce Services, but before I have done it myself, I never thought it would be so easy.

Problem: items with   in it’s title have unicode character for nonbreaking space in link address.

What I want: I want every “special” character to be replaced with default “-” dash.

How can I achieve that? First of all I was thinking about default Umbraco settings:

It just was not working. I even dig deep into Umbraco sources, only to find out few hours later, that this method is not even being called for uCommerce items. Is there a good reason for uCommerce to not use default Umbraco functionality? Not sure.

Once I realized it’s done in uCommerce UrlService, it was a matter of minutes to fix. Having ReSharper with on-the-fly decompilation really helped too. Here is what I see in default UrlService sources:

Now I just override it in my own inherited class:

And then I should tell uCommerce about my Service:

That’s it! Just override and drop a line into xml file! Now characters in address bar are filtered according to my rules. You can watch it work here, for example (warning: Russian language).