Jump to content
thirty bees forum

dollar euro


Recommended Posts

57 minutes ago, musicmaster said:

While entering prices in the backoffice I encountered the following little issue:


This shop is only in euro's. Yet the prices are quoted as "USD 1.99 ". Does anyone know where this USD comes from?

Yes, I didn't noticed it before...  but this USD has nothing to do it here and was not there in 1.0.8 version.

Edited by zen
Link to comment
Share on other sites

It comes from the function displayPrice that needs some correction in the file : js/tools.js

line 117

    if (currencySign && currencySign!== 'undefined') {
      formattedCurrency = formattedCurrency.replace('USD', currencySign);

And I am not sure it really needs to be there.. why replacing to USD, in others files it setup by default to euro € symbol... strange, maybe somebody can explain where does it comes from.


Edited by zen
Link to comment
Share on other sites

GetDatackick solved it :




displayPrice: always replace USD symbol

When Auto format is turned on for some currency, displayPrice javascript
method will use browser built-in support for currency formatting to
format currency in specific locale.

It does so by evaluating this expression:

return price
  .toLocaleString(locale, {
    style: 'currency',
    currency: 'USD',
    currencyDisplay: 'code'

This code ensures that the number is formatted using 'USD' string in
place of currency symbol. This 'USD' string is then replaced with actual
currency symbol.

However, there was a bug - this string replacement wasn't performed when
no currencySign was passed to the function. In such case, the string
with 'USD' symbol was returned.

This commit ensures that this USD symbol is always replaced, even with
the empty string.

Related to issue #865




Edited by zen
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...