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
Turn WC_Order::get_tax_location public #36953
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## trunk #36953 +/- ##
========================================
Coverage 46.7% 46.7%
Complexity 17188 17188
========================================
Files 429 429
Lines 64821 64826 +5
========================================
+ Hits 30251 30254 +3
- Misses 34570 34572 +2
|
Test Results SummaryCommit SHA: 5d25edd
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
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.
I have some concerns that there will always be versions of WooCommerce where this method isn't public, and simply changing it to public would encourage non-defensive coding, and perhaps lead to future errors here.
What do you think about having a simple public wrapper method that calls the protected method?
…d public wrapper get_taxable_location()for it.
Agree, I've made some changes to accommodate for this. |
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.
👍 thanks for updating
This PR turns the
get_tax_location
function public, this is needed so plugins like Avatax can get the tax location to recalculate taxes (for subscriptions for example). An alternative would be to duplicate the function.How to test the changes in this Pull Request:
This is a safe backward compatible change
Other information:
pnpm --filter=<project> changelog add
?FOR PR REVIEWER ONLY: