What not to do with your login/register page

This post is strictly my personal opinions, it does not represent my employer’s views in any way.

Login/register page is essential to any site, especially any Commerce site. You should always follow the proven, established practices, but yet many sites still have issues with their login and register page. Make sure that you do not do anything mentioned below:

  • Use HTTP for login/register page.

You might say “What?”. It’s 2016 already and certificate is cheap as hell (even free, if you count Letsencrypt). Still, there are Commerce sites use HTTP for login/register. This, sadly, happens to one of my favorite sites, itsajten:NonHttps (1)

In case of itsajten, there is not much of sensitive information an attacker can get if he sniffs the network and gets my password. I’m in Sweden and almost everything is transparent, even my income. But still, it does mean that I’m subject to social engineering attack. I notified itsajten about this but never heard from them since – which is a pity. They are otherwise very nice and they offer some of the best prices on the item I interested.

 
Continue reading “What not to do with your login/register page”

Diagnose your Episerver site: find and fix the issues

It’s quite often to see some questions related to issues posted in Episerver World forums. While I (and most of people there) are willing to help, it still takes time for you to write the question and wait for an answer. Sometimes, the answer can be incomplete or even incorrect, because the people answering your question do not have the full context as you do. The truth is, you’re the person who know the most about your site, and you can do something to diagnose it. Those steps below are in the order you should take to diagnose your site:

  • Browser console is your friend. It’s the thing which seemingly ignored the most. When something does not work in Edit UI (CMS) or Catalog UI (Commerce), make sure to open your Browser console and switch to Console tab. If their was a network issue, such as a 500 “Server error” response, make sure to open it. (Right click and choose “Open in a new tab” in Chrome). More often than you might think, it can reveal the underlying problem. If it’s a JavaScript error, how does it look like?
  • Logging is your (another) friend. When something seems to be wrong, check your log file, or turn down your logging level to see if you can see any trace there. In some case, no log found can also be a trace to solve the problem.
  • Does iisreset solve your problem? No I’m not suggesting you to run iisreset every minute on your production site, but it might isolate the problem – if it does, then the problem might relate to cache, or initialization modules. If it does not, well, it can be anything else. But at least it’s not caused by certain things – the key is to narrow down the causes of problem. You can also try to call

ISynchronizedObjectInstanceCache.Clear();

    • if the issue seems to related to the “modern” cache – such as ContentProvider. Note that ISynchronizedObjectInstanceCache does not control everything and iisreset is still the more powerful cache-clearing option.

Continue reading “Diagnose your Episerver site: find and fix the issues”

How Episerver Catalog content versions work

This is an excerpt from my book – Pro Episerver Commerce. Use http://leanpub.com/proepiservercommerce/c/Easter2016 to get 20% off the book during Easter holiday (Mar 24th – Mar 28th)

One of the most important features in CatalogContentProvider is it bring versioning to catalog content. It was somewhat limited with Commerce 7.5 (the languages handling was a bit sloppy), but it has been much more mature since Commerce 9. The versioning system in Commerce 9 is now more or less on par with versioning in CMS, and it’s a good thing.

If you’re new to Episerver CMS/Commerce, then it might be useful to know how version and save action work in content system. Of course, you can skip this section if you already know about it. The version status is defined in EPiServer.Core.VersionStatus. When you save a content, you have to pass a EPiServer.DataAccess.SaveAction to IContentRepository.Save method.

Continue reading “How Episerver Catalog content versions work”

Episerver Commerce routing internals, part 2

This post is a second post after http://vimvq1987.com/2016/03/episerver-commerce-routing-internals-part-1/ . The third part in the series can be found here: http://vimvq1987.com/2016/03/redirecting-your-product-urls-in-episerver-commerce/. (I know, I should have published the post in the right order.) They are all excerpts from my book – Pro Episerver Commerce.

The hierarchical approach:

This “new” approach (today it’s not new anymore, perhaps we can call it newer?) was introduced  in Commerce 7.5 to make the routing of Catalog contents inline with CMS content. The core concept of this approach is to reflect the structure of contents to the structure of the Uri, for the discoverability. With SEO Uri approach, customers will never know how to get to the parent node, to see the other items in same category. With the partial routing, they can. To allow that, every catalog content has a piece of information – RouteSegment. This is saved in CatalogItemSeo as UriSegment, but is hidden for editing in Commerce Manager

Continue reading “Episerver Commerce routing internals, part 2”

Episerver Commerce routing internals, part 1

Routing is important for any sites, and it’s even more important for a Commerce site – it can help driven sales. People nowadays search for everything, and ranking higher in the search results yield much better chance of your products being purchased. There are two routing systems in Episerver Commerce (as always!). The old one is based on SEO URI, has been there since Commerce R1, and the new one, HierarchicalCatalogPartialRouter, which is a partial router, was introduced in Commerce 7.5.

The SEO Uri approach

This approach is based on the SEO Uri, so the link to your product will be in form of http:///yourproduct.aspx. Note that .aspx is the default, but you are free to choose another extension, or even no extension at all. The SEO Uri can be edited in both Commerce Manager and Catalog UI

SEOCommerceManager
SEO Uri editing in Commerce Manager

Those information are stored in CatalogItemSeo for both Nodes and Entries, which each row represents the information of one node or one entry in one language. Note that only the Uri is unique and is used by the system, it’s up to your site implementation to utilize other information such as Title, Description – just follow best SEO practices.

Continue reading “Episerver Commerce routing internals, part 1”

Redirect your product URL:s in Episerver Commerce

Why redirect?

A very good thing about Episerver Commerce is that even you enabled the partial routing system, the old SEO Uri:s will continue to work (of course, as long as you keep the Uri:s unchanged). So they can coexist in same website – but that might not what you want – you might want to stick with only one routing system – it’s been told that the more popular your URL is, the higher rank it gets in the search engine results.

From hierarchial URL to SEO URL:

This one is pretty easy, just call this during your site’s initialization, the true parameter means you want to enable Outgoing Seo URI, and the next statement configures the redirect:

CatalogRouteHelper.MapDefaultHierarchialRouter(RouteTable.Routes, true);

CatalogRouteHelper.SetupSeoUriPermanentRedirect();

From SEO URI to hierarchial URI:

This one is tricky, there is no such built-in method allows us to do so. We can’t even override SeoUriRouter because it’s registered automatically and there is no way to guarantee that our router will be able to run before it. (If a matching router is found, the processing will stop).

Continue reading “Redirect your product URL:s in Episerver Commerce”

Episerver Commerce 2015 – year in review

Performance, performance, performance

While I’m proud of how great Commerce were in 2014, there are still areas where we need to improve. One of those is performance.
We paid attentions to important parts of the system, where customers demand the most. And the results were, quite impressive. From 8.11 to 8.15, many profiling and improvements had been done, and the results are quite expensive: loading cart performance increased 4 times, loading Entry with CatalogEntryResponseGroup.Full performance increased 3 times, etc.

However, the biggest change – “rewritten” catalog system, had to wait for Commerce 9.

Commerce 9 was, in no doubts, big release, in term of changes. And it surely is the biggest in term of performance gain. With the changes in underlying catalog system database, the performance gain is, massive. In some areas, the change is a whopping 10 fold, and other areas, 2-4x times faster. If you are still on Commerce 8.x, while it was a great product at its time, you are highly recommended to upgrade to latest 9.x version. Many customers’ve done it, and they’re more than happy with the performance. 2015 was the year which I can finally be happy with overall performance of Commerce. Of course, there are still rooms for improvements and we are not perfect yet, but let’s open a champagne for the performance gain we got.

New promotion system

I am OK with the old promotion system as an editor/administrator, but I’m no fan of it as a developer. When a bug is reported by the QA, I can follow the bug report to re-produce the bug for investigation, but when it comes to write an integration test to verify the correctness of bugfix (and of course, prevent the same mistake to be happenned in the future), I usually grin my teeth. So I’m all in favors for the new promotion system, when I can easily write tests for my fixes, and even unit tests (woo hoo). And did I mention a much more intuiative and well-designed UI?

Continue reading “Episerver Commerce 2015 – year in review”