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

Price tiers calculated on 2 decimals even when prices of 4 decimals are entered #15772

Open
dverkade opened this issue Jun 4, 2018 · 22 comments · May be fixed by #37942
Open

Price tiers calculated on 2 decimals even when prices of 4 decimals are entered #15772

dverkade opened this issue Jun 4, 2018 · 22 comments · May be fixed by #37942
Assignees
Labels
Area: Cart & Checkout Component: Checkout Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: PR in progress Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S2 Major restrictions or short-term circumventions are required until a fix is available.

Comments

@dverkade
Copy link
Member

dverkade commented Jun 4, 2018

Description

Although a lot of currencies use only 2 decimals for displaying a price, products might have to be calculated on smaller prices especially in the B2B space. For instance the product price is just 0.5292 per piece for 5 pieces (tier price). Magento now first round the price per piece to 0,53 and then multiplies that by the number you are buying (500), which makes for a total price of 265,00 instead of 264,40.

Preconditions

  1. Magento 2.2.4
  2. PHP 7.1
  3. Locale for the website is Netherlands in our case, but should be the same for US locale or any other locale where prices are displayed in 2 decimals.

Steps to reproduce

  1. Add a product
  2. Add a tier price and enter a 4 decimal price. For instance 0.5292 for 500 pieces.
  3. Open the backoffice again. You see that the prices are already displayed rounded to 0.53 instead of the entered 0.5292
  4. In de frontend, add 500 pieces of the product to the cart. The price in the cart is 265,00 instead of 264,40.

Expected result

  1. Round the price after calculating the total price for the product.

Actual result

image
Prices showing in de backoffice. They are rounded to two decimals.

image
Prices as they are stored in the database.

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jun 4, 2018
@ghost ghost self-assigned this Jul 6, 2018
@ghost ghost added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Component: Checkout Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development labels Jul 9, 2018
@ghost
Copy link

ghost commented Jul 9, 2018

@dverkade, thank you for your report.
We've acknowledged the issue and added to our backlog.

@ghost ghost removed their assignment Jul 12, 2018
@AleksLi AleksLi self-assigned this Mar 2, 2019
@magento-engcom-team
Copy link
Contributor

Hi @AleksLi. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

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

  • 2. Verify that the issue is reproducible on 2.3-develop branch

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

  • 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

AleksLi added a commit to AleksLi/msi that referenced this issue Mar 2, 2019
…n prices of 4 decimals are entered

Added extended rounding for Address Item to get more accurate calculation result
@orlangur
Copy link
Contributor

orlangur commented Mar 4, 2019

Closing in favor of https://github.com/magento/magento2/issues/10532. Entering four decimals price is not a valid use case currently.

@orlangur orlangur closed this as completed Mar 4, 2019
@dverkade
Copy link
Member Author

dverkade commented Mar 4, 2019

I'm reopening this issue. Unlike @orlangur is mentioning this is a valid use case. First of all, you can enter prices with 4 decimals in the backoffice, and they will actually be saved. Second of all, @magento-engcom-team has confirmed and reproduced this issue.

@dverkade dverkade reopened this Mar 4, 2019
@AleksLi
Copy link
Contributor

AleksLi commented Mar 4, 2019

@dverkade so what's now. Can it be fixed for particular use case as I've done in my PR #21554 or what? I mean in the scope of this ticket and then it could be fixed more generally.

@orlangur
Copy link
Contributor

orlangur commented Mar 5, 2019

has confirmed and reproduced this issue

@dverkade does not mean issue is valid, just that it is reproduced.

Open the backoffice again. You see that the prices are already displayed rounded to 0.53 instead of the entered 0.5292

DIsplaying 0.53 is correct behavior. However, it would be even better to have proper validation to allow entering only 2 digits after comma.

@orlangur orlangur removed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Mar 5, 2019
@dverkade dverkade added Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Mar 5, 2019
@ghost ghost removed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development labels Oct 20, 2020
@magento-engcom-team magento-engcom-team added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. labels Nov 30, 2020
@m2-community-project m2-community-project bot added this to Ready for Development in High Priority Backlog Nov 30, 2020
@php4umagento
Copy link
Contributor

This isisue is still reproducable with 2.3.5

@engcom-Alfa engcom-Alfa added Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Area: Cart & Checkout Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Aug 25, 2021
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.magento.com/browse/AC-1029 is successfully created for this GitHub issue.

@m2-assistant
Copy link

m2-assistant bot commented Aug 25, 2021

✅ Confirmed by @engcom-Alfa. Thank you for verifying the issue.
Issue Available: @engcom-Alfa, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@github-jira-sync-bot
Copy link

❌ Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.magento.com/browse/AC-1029

netdesign added a commit to netdesign/magento2 that referenced this issue Sep 13, 2021
Seems it fixes Issue magento#15772 on Magento 2.2.2 - Please validate on other versione
@netdesign
Copy link

Hello to all, please check this Pull Request commit 27cd977

It should fix the issue

@JettyRohanAditya
Copy link
Contributor

@magento I am working on this.

Copy link

m2-assistant bot commented May 13, 2024

Hi @engcom-Bravo. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

    1. Add/Edit Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
    1. 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!
    1. If the issue is not relevant or is not reproducible any more, feel free to close it.

@engcom-Bravo
Copy link
Contributor

@magento give me 2.4-develop instance

Copy link

Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Cart & Checkout Component: Checkout Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: PR in progress Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S2 Major restrictions or short-term circumventions are required until a fix is available.
Projects
High Priority Backlog
  
Pull Request In Progress