-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Fix inconsistent order total on checkout vs manual order page #33812
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
Conversation
The methods are moved to separate classes in src/Internal, and two new "core" methods that exclude HTTP processing are added.
Test Results SummaryCommit SHA: fbfbd6f
To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
|
@vedanshujain checking in to see if you've got any code review feedback on this PR (as it will help unblock some downstream work in the EU VAT extension)? |
vedanshujain
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
Hi @vedanshujain, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:
|
* fix: tax calculation and coupon sequence * add phpunit skeleton * Refactor calc_line_taxes and add_coupon_discount The methods are moved to separate classes in src/Internal, and two new "core" methods that exclude HTTP processing are added. * The test partially passes now * Final fix to unit tests, and fix remaining formatting issues * Add changelog file * Fix path to html-order-items.php Co-authored-by: Siddharth Thevaril <[email protected]>
All Submissions:
Changes proposed in this Pull Request:
Fixes inconsistent order total on checkout vs manual order page when the shop is configured for tax-inclusive prices and a coupon is applied. Also refactors the
add_coupon_discountandcalc_line_taxesmethods in theWC_AJAXclass to make the code more unit testable.Fix originally submitted by @Sidsector9 in #32010, work redone in a new pull request in order to easily apply ther required refactoring.
Note for reviewers: It's obscured by the refactor, but the main change in this pull request is executing
$order->calculate_taxesand$order->calculate_totalsbefore$order->apply_coupon, instead of after, insideadd_coupon_discount.Closes #31971.
How to test the changes in this Pull Request:
See #31971 and #32010
Other information:
pnpm changelog add --filter=<project>?FOR PR REVIEWER ONLY: