musicmaster Posted November 18, 2019 Posted November 18, 2019 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?
zen Posted November 18, 2019 Posted November 18, 2019 (edited) 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 November 18, 2019 by zen
zen Posted November 18, 2019 Posted November 18, 2019 (edited) 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 November 18, 2019 by zen
zen Posted November 18, 2019 Posted November 18, 2019 (edited) GetDatakick post this solution : https://github.com/thirtybees/thirtybees/commit/821de66a61eee4eed4acccc2b49a2b75f9c54498 Edited November 19, 2019 by zen 1
DRMasterChief Posted November 18, 2019 Posted November 18, 2019 So, do you think with the solution given at Github this problem is solved ? (i can confirm this issue in 1.1.0 , but it is not in 1.0.8)
zen Posted November 19, 2019 Posted November 19, 2019 (edited) GetDatackick solved it : Quote 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 November 19, 2019 by zen 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now