Check if official TaxJar plugin exists before enabling WCS integration (https://github.com/woocommerce/woocommerce-admin/pull/3183)

This commit is contained in:
Joshua T Flowers 2019-11-07 15:37:17 +08:00 committed by GitHub
parent 73b11a1338
commit c25c91126c
2 changed files with 5 additions and 2 deletions

View File

@ -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 )
); );
} }

View File

@ -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;
} }