Commerce: Revenue Chart showing wrong currency

Created on 18 Mar 2019  ·  11Comments  ·  Source: craftcms/commerce

Description

The revenue Chart on the Commerce plugin on the orders page and also the gadget showing ($) as the currency where the correct on is the (SAR) .

Regards

Steps to reproduce

1.In the settings of the commerce plugin we have only one currency which is (SAR) - Saudi Riyal (Primary).
2.The system will change to (SAR) except the revenue chart.

Additional info

  • Craft version: Craft Pro 3.1.15
  • PHP version: 7.2.16
  • Database driver & version: MySQL 5.5.5
  • Plugins & versions: Craft Commerce 2.1.2
    Screen Shot 2019-03-18 at 9 27 57 AM
🐞 bug 🧾 orders

Most helpful comment

Hey all,

A fix for this has been pushed for the next release.

All 11 comments

Are the amounts correct? Is it just the symbol?

The amount is correct but the decimal numbers are truncated ,
You can see that there is amount on 22nd with price ( SAR296.80 ) on the graph is truncated to : (296.00) and yes the symbol is also wrong on the tooltip as you can see on the screenshot.

image

We have the same issue but with 2 different currencies :) The install is set to € but the graph detail shows $.

Same. Widget works for my admin user, but user with reduced permissions gets it in $

Similar, we have the store currency set to GBP but it's showing a $ on the points on the chart.

Also, the revenue widget also shows in $ when we have GBP set.

Not sure if this is an issue from upgrading to Commerce 2 from Commerce 1.

Not sure if its applicable, but I've had similar issues before where the user account currently logged in has their language set to something else. This can happen on Craft 2 > 3 upgrades, or just setting the default language after install.

Make sure to go to your account and check your language is correct. For some locales, you might not see them in the dropdown, and you might have to include them manually.

For example, Australian English doesn't appear in that dropdown, so I need to add:

'defaultCpLanguage' => 'en_au',

To my general.php file. This is the default language for my site. Then I can select it from the list, and can help solve it.

@engram-design That does work and fix the problem. The site I had the issue on was a Craft 2 > Craft 3 build.

Is this missing somewhere when upgrading from Craft 2 > Craft 3 then?

@bymayo Possibly more of a Craft core issue, maybe @brandonkelly might have some insight?

Taking a look at this today, think it is to do with locale being supplied to the D3 charting lib by Craft.

Thanks @nfourtythree !

Hey all,

A fix for this has been pushed for the next release.

Was this page helpful?
0 / 5 - 0 ratings