Check if official TaxJar plugin exists before enabling WCS integration (https://github.com/woocommerce/woocommerce-admin/pull/3183)
This commit is contained in:
parent
73b11a1338
commit
c25c91126c
|
@ -107,10 +107,12 @@ class Tax extends Component {
|
||||||
|
|
||||||
isTaxJarSupported() {
|
isTaxJarSupported() {
|
||||||
const { countryCode, wc_connect_options } = this.props;
|
const { countryCode, wc_connect_options } = this.props;
|
||||||
const { automatedTaxSupportedCountries = [] } = getSetting( 'onboarding', {} );
|
const { automatedTaxSupportedCountries = [], taxJarActivated } = getSetting( 'onboarding', {} );
|
||||||
|
|
||||||
return (
|
return (
|
||||||
wc_connect_options.tos_accepted && automatedTaxSupportedCountries.includes( countryCode )
|
! taxJarActivated && // WCS integration doesn't work with the official TaxJar plugin.
|
||||||
|
wc_connect_options.tos_accepted &&
|
||||||
|
automatedTaxSupportedCountries.includes( countryCode )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,7 @@ class OnboardingTasks {
|
||||||
$settings['onboarding']['hasProducts'] = self::check_task_completion( 'products' );
|
$settings['onboarding']['hasProducts'] = self::check_task_completion( 'products' );
|
||||||
$settings['onboarding']['isTaxComplete'] = self::check_task_completion( 'tax' );
|
$settings['onboarding']['isTaxComplete'] = self::check_task_completion( 'tax' );
|
||||||
$settings['onboarding']['shippingZonesCount'] = count( \WC_Shipping_Zones::get_zones() );
|
$settings['onboarding']['shippingZonesCount'] = count( \WC_Shipping_Zones::get_zones() );
|
||||||
|
$settings['onboarding']['taxJarActivated'] = class_exists( 'WC_Taxjar' );
|
||||||
|
|
||||||
return $settings;
|
return $settings;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue