Skip to content

[Issue] Set correct discount package value for tablerate #30169

Closed
@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #30167: Set correct discount package value for tablerate


Preconditions (*)

Magento 2.4-develop

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)

Steps to reproduce: (*)

  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

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

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

Expected Result: ✔️ Shipping should be 5 euros

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

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)

Metadata

Metadata

Assignees

Labels

Component: OfflineShippingFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P3May be fixed according to the position in the backlog.Progress: doneReported on 2.4.0Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions