WC_Admin_Setup_Wizard::should_show_automated_tax
Deprecated since 4.6.0. It is no longer supported and may be removed in future releases. It is recommended to replace this function with the same one.
The "automated tax" extra should only be shown if the current user can install plugins and the store is in a supported country.
Method of the class: WC_Admin_Setup_Wizard{}
No Hooks.
Returns
null. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->should_show_automated_tax();
Changelog
| Deprecated since | 4.6.0 |
WC_Admin_Setup_Wizard::should_show_automated_tax() WC Admin Setup Wizard::should show automated tax code WC 10.5.0
protected function should_show_automated_tax() {
_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
if ( ! current_user_can( 'install_plugins' ) ) {
return false;
}
$country_code = WC()->countries->get_base_country();
// https://developers.taxjar.com/api/reference/#countries .
$tax_supported_countries = array_merge(
array( 'US', 'CA', 'AU', 'GB' ),
WC()->countries->get_european_union_countries()
);
return in_array( $country_code, $tax_supported_countries, true );
}