Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-decimal currency and XPF multi-currency bugs #5150

Closed
LevinMedia opened this issue Nov 17, 2022 · 6 comments · Fixed by woocommerce/woocommerce#46960 or #8722
Closed

Non-decimal currency and XPF multi-currency bugs #5150

LevinMedia opened this issue Nov 17, 2022 · 6 comments · Fixed by woocommerce/woocommerce#46960 or #8722
Assignees
Labels
category: core WC Payments core related issues, where it’s obvious. focus: multi-currency needs prioritisation Triage finished and issues are ready for the following processing. priority: medium The issue/PR is medium priority—non-critical functionality loss, minimal effect on usability type: bug The issue is a confirmed bug.

Comments

@LevinMedia
Copy link
Contributor

LevinMedia commented Nov 17, 2022

The Pacific Franc (XPF, a non decimal currency) has a number of bugs in both the currency management screen, and on the front end of the store.

Currency management screen:

  • the currency preview is producing incorrect previews given my configurations for rounding rules and price charming.
  • For the Pacific Franc (XPF) the currency symbol is incorrectly placed, and the wrong symbol.

Screen Shot 2022-11-17 at 7 00 04 AM

In the screen shot above, the preview price should be 115 and the currency symbol should be XPF, and precede the price with a space. In the example above, I would expect to see the preview displayed as XPF 115 This preview bug seems to affect ALL non decimal currencies. Here's another screen shot of Yen - although the yen currency symbol is placed correctly.

Screen Shot 2022-11-17 at 7 24 00 AM

The preview price should be ¥140

On the store front

On the front end of the store, the prices appear to be calculated correctly, however for the XPF currency, they're missing the coma separator for thousands, and also using the incorrect symbol (Trailing Fr, rather than the correct XPF preceding with a space) I tested for this using Yen, and the coma was placed correctly, so it looks like it might just be limited to XPF

Screen Shot 2022-11-17 at 7 04 56 AM

I've attached a few screen shots from business that charge customers in XPF to show how XPF is used as the currency symbol.

Screen Shot 2022-11-17 at 7 01 59 AM

Screen Shot 2022-11-17 at 7 03 17 AM

@LevinMedia LevinMedia added the type: bug The issue is a confirmed bug. label Nov 17, 2022
@jbordonado jbordonado added component: countries currencies localization category: core WC Payments core related issues, where it’s obvious. needs prioritisation Triage finished and issues are ready for the following processing. labels Nov 18, 2022
@vbelolapotkov
Copy link
Collaborator

Hey @LevinMedia, it feels great to keep getting your feedback, thank you ❤️

@jessy-p
Copy link
Contributor

jessy-p commented Jan 15, 2024

This issue impacts Multi-Currency, so assigning to Fractal (based on team responsibilities Pc2DNy-3z-p2) @bborman. Assigning as part of Gamma Triage process PcreKM-yM-p2.

Tagging as part of re-evaluating older issues in the backlog, please have a look and close if no longer relevant.

@pierorocca pierorocca added component: customer multi-currency Issues related to customer multi-currency project priority: medium The issue/PR is medium priority—non-critical functionality loss, minimal effect on usability labels Jan 29, 2024
@pierorocca pierorocca removed the component: customer multi-currency Issues related to customer multi-currency project label Mar 13, 2024
@bborman22
Copy link
Contributor

@cesarcosta99 cesarcosta99 self-assigned this Apr 16, 2024
@cesarcosta99
Copy link
Contributor

It looks like things are a bit different than the time this has been reported.

the currency preview is producing incorrect previews given my configurations for rounding rules and price charming.
...
In the screen shot above, the preview price should be 115 [XPF]
...
The preview price should be ¥140

The values in the currency preview seem correct now and match what's expected.

Pacific Franc Japanese Yen
image image

For the Pacific Franc (XPF) the currency symbol is incorrectly placed, and the wrong symbol.

The currency codes are retrieved from WC core here. And the get_woocommerce_currency_symbols function documents how the symbols are defined as follows:

Currency symbols and names should follow the Unicode CLDR recommendation https://cldr.unicode.org/translation/currency-names-and-symbols

I'm not familiar with this currency and the countries that use it, but according to the Symbols guidelines linked above, the XPF currency would fall into item 1.3, which says:

  1. If a symbol is not widely recognized around the world
    3. ...use the international currency symbol (eg ILS). This can be done just by omitting the translation

I also did some research and Wikipedia (and a few other sites) indicate that the symbol of the CFP franc currency is F.

The Fr symbol has been defined 6 years ago, but if I'm reading correctly the guidelines WC core is based on, the symbol should be changed to XPF, as suggested in this issue. The formatting of the value would be XPF 100. However, I'd like to have another pair of eyes to confirm my reasoning. Looping in @bborman22 to take a look when you have a chance.


Now, moving to the store frontend.

On the front end of the store, the prices appear to be calculated correctly, however for the XPF currency, they're missing the coma separator for thousands, and also using the incorrect symbol (Trailing Fr, rather than the correct XPF preceding with a space) I tested for this using Yen, and the coma was placed correctly, so it looks like it might just be limited to XPF

The trailing Fr seems to have been fixed, but the comma separator is still an issue and doesn't match what's seen in the currency preview. Regarding the XPF symbol, I'll wait the outcome of the aforementioned symbol discussion.

image

@cesarcosta99
Copy link
Contributor

cesarcosta99 commented Apr 26, 2024

image

With the new changes applied in the currency the formatting in the preview is going to be XPF1,234 (without a space between symbol and value). That's going to happen because, in the currency preview, the value is formatted based on the store currency formatting [ref].

I have conflicting perspectives about this approach because, as much as I understand this being easier for the store owner to understand the conversion, it's not representing accurately how the currency is going to be presented. @bborman22, I would appreciate a second opinion here to decide if we should keep this behavior, or change it to display the actual currency formatting.

@bborman22
Copy link
Contributor

Sorry I don't have a super strong understanding of the difference between this preview and the actual display, but I would expect them to match. This conflict between using store currency formatting in the admin has been a consistent problem I'm looking to get addressed.

Given the explicit context here that this is a preview of how it will be displayed, I would say we should use the front-end display rules if we can?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: core WC Payments core related issues, where it’s obvious. focus: multi-currency needs prioritisation Triage finished and issues are ready for the following processing. priority: medium The issue/PR is medium priority—non-critical functionality loss, minimal effect on usability type: bug The issue is a confirmed bug.
Projects
None yet
8 participants