Skip to content

Set correct discount package value for tablerate #30167

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

Merged
merged 12 commits into from
Oct 15, 2020

Conversation

basvanpoppel
Copy link
Contributor

@basvanpoppel basvanpoppel commented Sep 23, 2020

Description (*)

This PR fixes the issue for the table rate carrier where the 'package value with discount' in the RateRequest is filled with the package value without the discount.

Currently, when you have a cart rule which sets a discount on the cart, the discount will not be used for the table rate.

Steps to reproduce:

  1. Create a table rate based on subtotal, f.e. 5 euro from a subtotal of 0, free shipping from a subtotal of 100 euros.
  2. Create a cart rule which sets a discount of 10% on cart, on subtotal only
  3. Ensure you have an item in your cart which has the discount, with a value of between 105 euros.
  4. The cart rule subtracts 10,5 from 105 - resulting in a total of 94,50. Shipping should be 5 euros as the subtotal now is below 100, but it's 0 because the price value without discount is used.

Related Pull Requests

Fixed Issues (if relevant)

Manual testing scenarios (*)

  1. Create a table rate based on subtotal, f.e. 5 euro from a subtotal of 0, free shipping from a subtotal of 100 euros.
  2. Create a cart rule which sets a discount of 10% on cart, on subtotal only
  3. Ensure you have an item in your cart which has the discount, with a value of between 105 euros.
  4. The cart rule subtracts 10,5 from 105 - resulting in a total of 94,50. Shipping costs of 5 euros are applied, order total is 99,50.

Questions or comments

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)
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] Set correct discount package value for tablerate #30169: Set correct discount package value for tablerate

@m2-assistant
Copy link

m2-assistant bot commented Sep 23, 2020

Hi @basvanpoppel. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ 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

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

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

⚠️ According to the Magento Contribution requirements, all Pull Requests 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 Pull Requests 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

@swnsma
Copy link
Contributor

swnsma commented Sep 23, 2020

Hi @basvanpoppel!
Thank you for your pull request!
Could you please sign Adobe CLA before we can start reviewing your pull request?

@swnsma swnsma self-requested a review September 23, 2020 13:14
@sidolov sidolov added Priority: P3 May be fixed according to the position in the backlog. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Sep 23, 2020
@sidolov
Copy link
Contributor

sidolov commented Sep 23, 2020

@magento create issue

@basvanpoppel
Copy link
Contributor Author

Hi @swnsma I've signed the CLA.

Please let me know if more information is needed, I'm happy to provide it.

Copy link
Contributor

@swnsma swnsma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @basvanpoppel,

According to Magento Definition of Done all pull requests should have an auto tests coverage.
May I ask you to introduce an Integration or MFTF test scenario which could verify that bug in the PR can not be reproduced anymore?

@swnsma swnsma added Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests Award: bug fix labels Sep 26, 2020
@ghost ghost assigned swnsma Sep 26, 2020
@swnsma
Copy link
Contributor

swnsma commented Sep 27, 2020

@magento run all tests

@basvanpoppel
Copy link
Contributor Author

@magento run all tests

@basvanpoppel
Copy link
Contributor Author

Hi @basvanpoppel,

According to Magento Definition of Done all pull requests should have an auto tests coverage.
May I ask you to introduce an Integration or MFTF test scenario which could verify that bug in the PR can not be reproduced anymore?

Hi @swnsma,

I've written a MFTF test scenario to verify that the issue won't be reproduced anymore.

I've ran all tests. The reports don't mention any issues related to this pull request.

@basvanpoppel basvanpoppel requested a review from swnsma September 29, 2020 17:47
@swnsma
Copy link
Contributor

swnsma commented Oct 4, 2020

@magento run Functional Tests B2B, Functional Tests CE

@swnsma
Copy link
Contributor

swnsma commented Oct 4, 2020

@magento run Functional Tests B2B

@engcom-Charlie engcom-Charlie self-assigned this Oct 5, 2020
@swnsma
Copy link
Contributor

swnsma commented Oct 5, 2020

@magento run Functional Tests B2B

@magento-engcom-team
Copy link
Contributor

Hi @swnsma, thank you for the review.
ENGCOM-8308 has been created to process this Pull Request

@swnsma
Copy link
Contributor

swnsma commented Oct 7, 2020

@magento run Functional Tests B2B

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

Manual testing scenario:

  1. Create a table rate based on subtotal, f.e. 5 $ from a subtotal of 0, free shipping from a subtotal of 100 $.

Screenshot from 2020-10-06 15-10-32

  1. Create a cart price rule which sets a discount of 10% on the cart, on subtotal only;
  2. Ensure you have an item in your cart which has the discount, with a value of between 105 $;

Screenshot from 2020-10-07 16-01-22

Before: ✖️ Shipping amount is 0 because the price value without discount is used.

2020-10-07_16-00
2020-10-06_14-22

After: ✔️ Shipping costs of 5 $ are applied

2020-10-07_16-08
2020-10-07_16-09

@engcom-Alfa engcom-Alfa added QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope and removed QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) labels Oct 7, 2020
@engcom-Charlie
Copy link
Contributor

@magento run all tests

@gabrieldagama
Copy link
Contributor

@magento run all tests

@m2-assistant
Copy link

m2-assistant bot commented Oct 15, 2020

Hi @basvanpoppel, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Award: MFTF test coverage Component: OfflineShipping Component: Shipping Partner: Redkiwi partners-contribution Pull Request is created by Magento Partner Priority: P3 May be fixed according to the position in the backlog. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Issue] Set correct discount package value for tablerate
7 participants