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

bugfix: fix cartFix rules incorrect discount ammount #39231

Conversation

joacols
Copy link

@joacols joacols commented Oct 1, 2024

  • Add init totals into foreach rules loop to allow for total calculation after each rules apply on Discount.php

  • remove logic for adding item discount to address base discount on Discount.php

  • on CartFixed.php now use validator to calculate current valid items total discount for rule on proporcional discount calculation.

refs: #38694

Description (*)

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes [Issue] Sales rule CartFixed calculation : incorrect discount amount #38694

Manual testing scenarios (*)

  1. create multiple cartFix rules and apply them. 
    
  2. also, see the case reported in the issue to be sure. 
    

Questions or comments

i tested this on my project with my own integration tests. is there a simple way of seting up this github environment?
a one liner setup would be excelent if there is none but i dont have the time to set it up right now.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

- Add init totals into foreach rules loop to allow for total calculation after each rules apply on Discount.php

- remove logic for adding item discount to address base discount on Discount.php

- on CartFixed.php now use validator to calculate current valid items total discount for rule on proporcional discount calculation.

refs: magento#38694
Copy link

m2-assistant bot commented Oct 1, 2024

Hi @joacols. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.
❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@m2-community-project m2-community-project bot added the Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. label Oct 1, 2024
@joacols joacols closed this Oct 1, 2024
@joacols joacols reopened this Oct 1, 2024
@joacols joacols changed the title bugfix: bugfix: fix cartFix rules incorrect discount ammount Oct 1, 2024
@joacols joacols closed this Oct 1, 2024
@joacols joacols reopened this Oct 1, 2024
@joacols
Copy link
Author

joacols commented Oct 2, 2024

@magento run all tests

@joacols
Copy link
Author

joacols commented Oct 2, 2024

failed tests have nothing to do with my code

@engcom-Bravo
Copy link
Contributor

Hi @joacols,

Thank you for your contribution!

The Magento core engineering team is working on the issue which you have addressed in this PR. Team will cherry pick the commits from your PR and may do further implementation to cover few more scenarios as needed. We will reach out to you if we need more information. For now, you can pause work on this PR.

Thank you once again!

@engcom-Bravo
Copy link
Contributor

Hello,

As I can see this issue got fixed in the scope of the internal Jira ticket ACP2E-3349 by the internal team
Related commits:https://github.com/search?q=repo%3Amagento%2Fmagento2+ACP2E-3349&type=commits

Based on the Jira ticket, the target version is 2.4.8-beta2.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue] Sales rule CartFixed calculation : incorrect discount amount
3 participants