Merging carts when a customer logs in

It’s quite common when a customer browses your site without logging in – either she/he intentionally does that, or just forget about logging in. The customer might add some items to carts and even checks out, but then is asked to log in or remember to log in. What would happen?

By default, Episerver Commerce will do as following:

  • Attach all orders made by that section to logged in customer. (I once placed an order in a famous retailer in Sweden without logging in, and then I asked their customer service to link that order to my account so I can track it easier. To my surprise, it cannot be done! That’s why I personally appreciate this feature.)
  • Merge all carts to existing carts, by name and market. So if I’m currently in US market and I added a item to that cart, and the US-cart linked to my account already have 2 other items, then when I log in, my US-cart will contain 3 items.
  • Merge all wishlist to existing wishlists, also per market. (The name for wishlist, by default, is fixed to “Wishlist”)

Continue reading “Merging carts when a customer logs in”

Multisite in Episerver Commerce

It seems that we currently have an increasing number of questions regarding multisite feature in Episerver Commerce. It’s fully supported in CMS. You can have only one site, one database to serve multiple domains – which of course reduces the cost. But can it be done in Commerce as well?

The answer is (as almost always): it depends on your definition of “multisite”: multisite can be that customers see multiple domains, which probably different styles, but in the backend everything is the same – you share the same collection of orders and customers. Or multisite can be that there is a separation in backend: each site has its own collection of orders and customers.
Continue reading “Multisite in Episerver Commerce”

Can Episerver Commerce support our catalog size?

One of the questions customers usually raise during evaluation of Episerver Commerce is : “Can it support our catalog size? We have (a very big number of ) SKUs. Will it work?”

Definitely, maybe.

I’ve seen “big” catalogs. Some very big. Million and more products.

The correct term would be “Entries”, as in a standard implementation your catalog can contain products, variants (of those products, or standalone ones), bundle and package. However for the sake of simplicity, we will refer to them as “products”. So when we talk about 2 million products, it is the 2 million entries. (you can have 100k products, 1.800k variants and 100k packages)

Theoretically, Episerver Commerce can support up to 512 millions 1 billion of entries (!), so you can have pretty much anything in your catalog until you reach a hard technical limit. Just for comparison, Amazon.com, which is arguably the biggest eCommerce site on the world, has about 500 millions SKU(s) in 2015. But the number of entries is not everything. There are several factors which determine your catalog “size”. the number of entries is an important factor, but there are several other factors as well.

Continue reading “Can Episerver Commerce support our catalog size?”

Watch your indexes closely

Recently we were tasked to help a customer having a problem with a query. This specific query ate a lot of CPU resources (30-40%) and causing performance problem for other queries – as it slows the entire SQL Server instance down.

Upon investigation, we discovered that the query was accessing a table with an outdated index. The index was supposedly updated in Episerver Commerce 7.10.3, which was released almost 3 years ago.

For some reasons, the index was not updated in customer’s table. Instead of just having to do a index seek, SQL Server was forced to do a full table scan, which is much slower, causing the problem.

If you want to go into details, it’s mdpsp_getchildrenbysegment stored procedure, which looks into UriSegment column of CatalogItemSeo table, previously, the index was like this:

CREATE NONCLUSTERED INDEX [IX_CatalogItemSeo_UniqueSegment_CatalogEntry] ON [dbo].[CatalogItemSeo]
(
    [ApplicationId] ASC
    [UriSegment] ASC,
    [CatalogEntryId] ASC
)

You can see the problem: The order of the index was bad – because ApplicationId was not distinctive (in fact, in most of the cases it’s the same for every row), and because UriSegment was not the first column in the index, this index will not be used if a query uses UriSegment only. Continue reading “Watch your indexes closely”

Quicksilver + ServiceAPI: the authentication issues

It’s possible to run Quicksilver and ServiceAPI on a same site, with some modifications, as I blogged here. However, if you go down that path, there is something you must keep in mind: They are not using the same authentication mechanism.

I’ve seen issues where Quicksilver implementations have some WebAPI controllers, which were working fine until ServiceAPI is installed. The controllers started returning null for CustomerContext.Current.CustomerContact, and so on, breaking some functionalities. It’s bad, yes, but it happens because of reasons.

Continue reading “Quicksilver + ServiceAPI: the authentication issues”

How can Horizon: Zero Dawn be (even) better?

If you own a PS4, you might want to try out Horizon: Zero Dawn, and if don’t have a PS4, you might want to buy a PS4 Pro + a HDR TV to try it out. Yes, the game is a blast to play: vast, beautiful world – which will drop your jaw frequently, and fun, exciting combat with the dino-robots. The game is selling very well and an expansion is under the work already – and I’d not be surprised if a sequel Horizon: Zero Dawn is announced in the future. But, can it be better? Yes! How?

Continue reading “How can Horizon: Zero Dawn be (even) better?”

The super short review of Horizon: Zero Dawn

Plus:

  • The game is very well polished. Everything seems smooth, and I’m yet to see any game breaking bugs (I’m looking at you, Witcher 3, and XCOM 2)
  • A vast, beautiful open world. Probably the most beautiful ever in a game. Even on the original PS4, it looks spectacular. PS4 Pro + HDR will blow your mind away – well, Sony made sure the game is a showcase for PS4 Pro, so that’s expectedIf you think Rise of Tomb Raider was visually stunning, think again. HZD easily blows it out of water. In short, it will drop your jaw!
  • The combats versus machines are engaging and rewarding. The bigger, badder the robot, the more satisfying you’ll be after a battle. You will have to be both smart, and fast to win. The variety and diverAlso, the Critical Hit move feels both powerful and satisfying.

Neutral:

  • The story is fine, but not really ground breaking. Passable but don’t expect anything like The Witcher 3.
  • The open world settings get bored after a while. Still many things to do, but you’ll probably want more.

Minus:

  • The combats versus humans are … meh. It’s not that bad, but compared to the machines, humans are just boring enemies which bring very little enjoyment to the table.
  • The voice acting is underwhelming. In many cases, voice actors do not sound convincing as they should. The NPC faces are also quite generic and you’ll have hard time remember who is who.
  • Stealth action is a joke – you caused an explosion and your enemies are still acting like nothing happen. If you expect the level of Metal Gear Solid V depth – I have bad news for you.

Verdict:

9/10. Buy it! If you have PS4 Pro + HDR TV and it’s easily a must have. If you don’t, then this is a very valid reason to buy those!

Tale from inside TransactionScope

One of the last things you want to get from your Commerce site is that the order data is gone. What can be more confused than if your log shows that the cart has been converted into a purchase order, you even got the PO number, but after that, the order disappears? It’s nowhere to be found, even if you look into database. It’s kind of magic, but not the kind of magic you would want to have.

But everything happens for a reason. And actually it’s with a good reason: data consistency.

Episerver Commerce has the concept of TransactionScope. Simply put, it allows two or more database operations to be done as atomic: Either all of them succeed, or all of them will revert back. If a TransactionScope contains 3 operations A, B, C, then even if A, B succeeded, but C is yet to commit, and something goes wrong, then A and B would be reverted.

Continue reading “Tale from inside TransactionScope”

PS4 firmware 4.5 wifi problem fixed

And finally the much anticipated 4.5 firmware of PlayStation 4/4 Pro has arrived, with some very neat features: extended storage, custom themes. It’s a big improvement for PS4 users, well, almost: the firmware comes with a big problem for ones who are using wifi: the download speed is now terrible, and even worse, the lag in game is making the games unplayable. Before 4.5, I had no problem joining matches on Uncharted 4, and playing Titanfall was very smooth – ping is never more than 100ms. After 4.5, I can’t hardly join a match on Uncharted 4 (errors in connections), and the lag in Titanfall spikes to more than 2000ms, making the game totally unplayable. Test Internet Connection shows that I have a a few hundred Kbps upload and download, when the wifi connection is supposed to be 130Mbps (PS4 ony has 2.4Ghz wifi 802.11 b/g/n, only PS4 Pro has 5Ghz wifi), and my internet connection is 250/100Mbps, so that must be a big problem somewhere.

Continue reading “PS4 firmware 4.5 wifi problem fixed”

The Catalog UI trade-off: performance or better UI

I supposed this is a well known feature, but I was asked more than once about it, so it’s better to write something here to clarify the confusions.

If you have some very, very big catalogs, you probably have seen this “notification” in Catalog UI

By default, the Catalog UI groups a product and its variations in a parent-children view (they are not exactly parent-children, by the way). However, to do that, it needs to know about all the entries in that specific category. If it’s a small category, it should be no problem, but if it’s big one, then it’s inevitable slow. The lazy loading which the catalog content list only loads the contents when you scroll to them is not helping in this matter. Moreover, the grouping introduces an overhead for the UI, and having too many groups can severely affect the performance. Trust me, you won’t like a sluggish UI.

This improvement was introduced way back – 7.11 if I remember correctly – thanks to my colleague Magnus Rahl. To this day it’s still valuable – the performance was improved – but not that much to remove the threshold completely (And the improvement to the catalog versioning in Commerce 9 should have nothing to do with this).

When you see this notification, and if you’re unhappy with it, you have two (primary) options: Either to sub-categorize your category – i.e. introduce sub categories so each will have a smaller number of entries. Or increase the value of threshold.

Each approach has its own disadvantages. Sub-categorizing might break your SEO, while the second approach will undoubtedly effect the UI performance. Your call!

Now – the tricky part – which number to configure in SimplifiedCatalogListingThreshold setting. Obviously, it must be greater than the biggest number of entries in a category. But how to obtain that number? I’ve seen the confusion to raise that value to 3000, 5000, or even 10000 and it’s still not working. No, you can’t guess, you have to know for sure.

One simple option is to look at Commerce Manager Catalog Management. There is a small text in right corner of the list which shows the number of entries in that category (No, it’s not available in the Catalog UI, but I assume it would be helpful?)

 

The nuke option is to look at the database. Usually we recommend to avoid manipulate the database directly, as it can be dangerous – but here is a little code which only queries data (so practical harmless)

SELECT CatalogNodeId, Count(CatalogEntryId) 

FROM dbo.NodeEntryRelation

GROUP BY CatalogNodeId

ORDER BY Count(CatalogEntryId) DESC

Now you know the biggest number of the entries in a category – just change the threshold in setting. Try it and see if the UI Performance is acceptable to you.