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

Currency symbol for Danish Krone doesn't match what is shown in the backend. #32256

Open
1 of 5 tasks
jupiterhs opened this issue Feb 23, 2021 · 17 comments
Open
1 of 5 tasks
Labels
Component: CurrencySymbol Component: Locale Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: ready for confirmation Priority: P3 May be fixed according to the position in the backlog. Progress: ready for dev Reported on 2.4.0 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.

Comments

@jupiterhs
Copy link

jupiterhs commented Feb 23, 2021

Preconditions (*)

  1. Magento 2.4.0 (2.4-develop)

Steps to reproduce (*)

  1. Set Locale to Danish (Denmark)
    Set Locale
  2. Set Base Currency and Default Display Currency to Danish Krone

Expected result (*)

  1. Should display the currency symbol as DKK in the frontend as defined in the backends Currency Symbol section
    Backend currency symbol

Actual result (*)

  1. Displays kr in the frontend instead of DKK
    Frontend currency symbol

More Information

  1. If we switch the Locale to English (United States) then it shows DKK in the frontend as expected.
    Showing DKK

Workaround

  1. Put a space before the currency symbol in the backend.

What I have found

  1. The kr comes form the file public_html/vendor/magento/zendframework1/library/Zend/Locale/Data/da.xml line 3668

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Feb 23, 2021

Hi @jupiterhs. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@jupiterhs
Copy link
Author

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @jupiterhs. Thank you for your request. I'm working on Magento instance for you.

@engcom-Bravo engcom-Bravo self-assigned this Feb 23, 2021
@m2-assistant
Copy link

m2-assistant bot commented Feb 23, 2021

Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@jupiterhs
Copy link
Author

Hi I am able to reproduce this on the 2.4-develop instance

@engcom-Bravo
Copy link
Contributor

Hello @jupiterhs

Thank you for your report

We have set the Interface Locale to Dansk (Danmark) / dansk (Danmark)
locale

and set Base Currency and Default Display Currency to dansk krone
def_base

The products on the Storefront are displayed with DKK currency as described in the Expected Result
front

Can you please correct our steps?

Thank you in advance

@engcom-Bravo engcom-Bravo added the Issue: needs update Additional information is require, waiting for response label Feb 23, 2021
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board Feb 23, 2021
@jupiterhs
Copy link
Author

Hi @engcom-Bravo
Thanks for checking.

I have updated the issue.
You need to set the locale like below
Set Locale

@engcom-Bravo
Copy link
Contributor

@jupiterhs Thank you for the quick response.

The Storefront is using the Currency Symbol specified in Stores - Currency Symbols
cur_sym
If you'll change the default ".kr" to "DKK", the symbol "DKK" will be displayed on the Storefront

@jupiterhs
Copy link
Author

jupiterhs commented Feb 23, 2021

@engcom-Bravo
You are able to change it to DKK because you changed the Interface Local. Please try switching it back to English and you should see something like below and then you should be able to see the issue.

Currency setup

@jupiterhs
Copy link
Author

jupiterhs commented Feb 26, 2021

Hi @engcom-Bravo
Hope you are having a good day :)
did you get a chance to check this out?

@engcom-Bravo
Copy link
Contributor

Hello @jupiterhs

Sorry for the delay. We Confirm that the issue is reproducible on the latest 2.4-develop.
Thank you for updating the description, and for communication.

@engcom-Bravo engcom-Bravo removed the Issue: needs update Additional information is require, waiting for response label Feb 26, 2021
@m2-community-project m2-community-project bot moved this from Needs Update to Ready for Confirmation in Issue Confirmation and Triage Board Feb 26, 2021
@engcom-Bravo engcom-Bravo added Reported on 2.4.0 Indicates original Magento version for the Issue report. and removed Issue: ready for confirmation labels Feb 26, 2021
@engcom-Bravo engcom-Bravo added Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Component: Locale Component: CurrencySymbol Priority: P3 May be fixed according to the position in the backlog. labels Feb 26, 2021
@m2-community-project m2-community-project bot added this to Dev In Progress in Low Priority Backlog Feb 26, 2021
@m2-community-project m2-community-project bot removed this from Ready for Confirmation in Issue Confirmation and Triage Board Feb 26, 2021
@engcom-Bravo engcom-Bravo added Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. and removed Progress: dev in progress labels Feb 26, 2021
@m2-community-project m2-community-project bot moved this from Dev In Progress to Ready for Development in Low Priority Backlog Feb 26, 2021
@engcom-Bravo engcom-Bravo added the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Feb 26, 2021
@m2-community-project m2-community-project bot moved this from Ready for Development to Dev In Progress in Low Priority Backlog Feb 26, 2021
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-Bravo
Thank you for verifying the issue. Based on the provided information internal tickets MC-41078 were created

Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@stale
Copy link

stale bot commented May 13, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!

@stale stale bot added the stale issue label May 13, 2021
@mortenbirkelund
Copy link

Still relevant

@stale stale bot removed the stale issue label May 13, 2021
@4DallasC
Copy link

Howdy All,

Having the same problem with PHP v7.4 and not with PHP v7.3. Looks like a change to how PHP's \NumberFormatter::formatCurrency operates when the second parameter string $currency is provided. In v7.4 it now overrides the applied setting of the currency symbol with the default in PHP.

The following edit is required in \Magento\Directory\Model\Currency::formatCurrency(string $price, array $options): string:-

$formattedCurrency = $this->numberFormatter->formatCurrency(
   $price, $this->getCode() ?? $this->numberFormatter->getTextAttribute(\NumberFormatter::CURRENCY_CODE)
);

to:-

$formattedCurrency = $this->numberFormatter->format($price);

@bobemoe
Copy link
Contributor

bobemoe commented Jun 28, 2022

Having same issue, 2.4.4CE

The workaround specified in OP ("Put a space before the currency symbol in the backend.") works fine for me.

The code change in post directly above does not make any difference for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: CurrencySymbol Component: Locale Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: ready for confirmation Priority: P3 May be fixed according to the position in the backlog. Progress: ready for dev Reported on 2.4.0 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
Low Priority Backlog
  
Ready for Development
Development

No branches or pull requests

6 participants