-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Issue with multiple percentage discounts #39036
Comments
Hi @serhiikv. Thank you for your report.
Join Magento Community Engineering Slack and ask your questions in #github channel. |
Hi @engcom-Bravo. Thank you for working on this issue.
|
@magento give me 2.4-develop instance |
Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-Bravo, here is your Magento Instance: https://16d879d04480f916c2d2f786540d1680.instances-prod.magento-community.engineering |
Hi @serhiikv, Thanks for your reporting and collaboration. We have verified the issue in Latest 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots. ![]() In API response receive discount_percent equals 13 Hence Confirming the issue. Thanks. |
✅ Jira issue https://jira.corp.adobe.com/browse/AC-12754 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-Bravo. Thank you for verifying the issue. |
- fixed incorrect discount percent calculation
- change copyright
@magento I'm working on it |
Preconditions and environment
Steps to reproduce
1. Create new cart price rules with the following configuration
Rule 1:
Rule 2:
orders/{id}
for this orderExpected result
In API response receive
discount_percent
equals 12.7Actual result
In API response receive
discount_percent
equals 13Additional information
Magento2 REST api for
orders
has one field fordiscount_percent
. In case when order has multiple discounts they are just added. This results in incorrect calculation.e.g.
order amount 12. discount1 = 10%, discount2 = 3%.
How magento2 does calculation:
But if API response is used to calculate discount - it will result in wrong discount amount:
The correct
discount_percent
in this case would be 12.7:Is it possible to change logic behind
discount_percent
field in REST API response in case of multiple discounts?Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: