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

Turn WC_Order::get_tax_location public #36953

Merged
merged 3 commits into from Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,4 @@
Significance: minor
Type: add

Make WC_Order::get_tax_location accessible publicly through a wrapper function.
11 changes: 11 additions & 0 deletions plugins/woocommerce/includes/abstracts/abstract-wc-order.php
Expand Up @@ -1670,6 +1670,17 @@ protected function get_tax_location( $args = array() ) {
return apply_filters( 'woocommerce_order_get_tax_location', $args, $this );
}

/**
* Public wrapper for exposing get_tax_location() method, enabling 3rd parties to get the tax location for an order.
*
* @since 7.6.0
* @param array $args array Override the location.
* @return array
*/
public function get_taxable_location( $args = array() ) {
return $this->get_tax_location( $args );
}

/**
* Get tax rates for an order. Use order's shipping or billing address, defaults to base location.
*
Expand Down