1

I'm working on a project where we are using Sitecore Experience Commerce 9.0 Update-1. When I try to add a price to a sellable-item, I have the problem, that I cannot save prices with decimal places.

When I try to use the American format (with a dot as a decimal separator), the dot will just be ignored. So if I enter "3.99" into the input, it will save "399".

Input 3.99

Saved as 399

When I try to use the German format (with a comma), it will give me an error.

Price has incorrect decimal value

Has anybody seen a problem like this in Sitecore XC 9?

  • It was a problem in 8.2.1 as well. You also could not enter any price > 999. Sitecore provided a fix for 8.2.1. You probably need to make sure you are logged in as a user editing "en" content, using "en" as your preferred language - and "en" being the default locale on the server. With all of the above, maybe. Just maybe. – Mark Cassidy May 29 '18 at 15:34
  • Really. :-( OK, I might give it a try. But that doesn't sound like a real solution to me. But thank you for the heads up. – n-develop May 29 '18 at 15:37
  • 1
    It's related to machine locale, try to change Region Format to English (United State). I've just tried to add price for snapshot like 3.99 and it works – Andrei Paliakou May 29 '18 at 15:41
  • Is this the only way to get this working? The customer owns the server and it is not hosted in the US. I will ask them, but I'm not sure if they are willing to change the Region Format. – n-develop May 29 '18 at 16:13
  • 1
    Get the hotfix from Sitecore. But you need to go via their support portal for that. – Mark Cassidy May 29 '18 at 16:25
1

I talked to the Sitecore Support about this issues. This is a known bug in the Commerce Engine. The fix for this is the following:

  1. Open Commerce Engine SDK project
  2. Open "Startup.cs" file of Sitecore.Commerce.Engine project
  3. Add the following code to the end of "Configure" method

CultureInfo.CurrentCulture = new CultureInfo("en-US");

  1. Build project
  2. Stop Commerce Engine and replace the "Sitecore.Commerce.Engine.exe" with one which you'be built.

We are using Sitecore Commerce 9 Update 1. I don't really know, if this is already fixed in Update 2. But if you are running Update 1 or the initial release, that should fix it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.