Skip to content

Bundle Special Prices not correctly rounded #17638

@Stassy

Description

@Stassy

When adding a Special Price to a bundle like 78,9473% (4 decimals), it's saved ok in the database.
If you load the same bundle and save again, it's changed to 78.95% (2 decimals)

Preconditions

  1. Magento 2.2.5 (able to reproduce everytime)

Steps to reproduce

  1. Create one product with price 760€
  2. Create a bundle with this product
  3. Set a special price to this bundle to 78.9473%
    (I want price of this bundle to be 600€. So 600€ / 760€ = 0,7894736842)
  4. Save bundle only ONCE !!!!! (DO NOT RELOAD IT, DO NOT SAVE A SECOND TIME)
  5. Check in DB : SELECT * FROM catalog_product_entity_decimal WHERE attribute_id = 78;
    value is 78.9473
  6. Open bundle again and go to Advanced pricing --> Value is 78.95%
  7. Don't touch anything and Save bundle
  8. Check in DB : SELECT * FROM catalog_product_entity_decimal WHERE attribute_id = 78;
    value is 78.95
  9. As a final result in the shop, bundle price is 600,01€

Expected result

  1. In Step 6, expected value should be the one in database : 78,9473% (not rounded)

Actual result

  1. In Step 6, value is rounded to 2 decimals at 78.95%

EXTRA INFO

Maybe a link with this issue from PierreLeMaguer : #15311

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: BundleFixed in 2.2.xThe issue has been fixed in 2.2 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions