From c25c91126c4f34355d61f557cb3860670fe105d0 Mon Sep 17 00:00:00 2001 From: Joshua T Flowers Date: Thu, 7 Nov 2019 15:37:17 +0800 Subject: [PATCH] Check if official TaxJar plugin exists before enabling WCS integration (https://github.com/woocommerce/woocommerce-admin/pull/3183) --- .../client/dashboard/task-list/tasks/tax.js | 6 ++++-- plugins/woocommerce-admin/src/Features/OnboardingTasks.php | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/woocommerce-admin/client/dashboard/task-list/tasks/tax.js b/plugins/woocommerce-admin/client/dashboard/task-list/tasks/tax.js index b0b9912c953..9c07c6cf452 100644 --- a/plugins/woocommerce-admin/client/dashboard/task-list/tasks/tax.js +++ b/plugins/woocommerce-admin/client/dashboard/task-list/tasks/tax.js @@ -107,10 +107,12 @@ class Tax extends Component { isTaxJarSupported() { const { countryCode, wc_connect_options } = this.props; - const { automatedTaxSupportedCountries = [] } = getSetting( 'onboarding', {} ); + const { automatedTaxSupportedCountries = [], taxJarActivated } = getSetting( 'onboarding', {} ); 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 ) ); } diff --git a/plugins/woocommerce-admin/src/Features/OnboardingTasks.php b/plugins/woocommerce-admin/src/Features/OnboardingTasks.php index 49508e440f9..c7c73aa4997 100644 --- a/plugins/woocommerce-admin/src/Features/OnboardingTasks.php +++ b/plugins/woocommerce-admin/src/Features/OnboardingTasks.php @@ -95,6 +95,7 @@ class OnboardingTasks { $settings['onboarding']['hasProducts'] = self::check_task_completion( 'products' ); $settings['onboarding']['isTaxComplete'] = self::check_task_completion( 'tax' ); $settings['onboarding']['shippingZonesCount'] = count( \WC_Shipping_Zones::get_zones() ); + $settings['onboarding']['taxJarActivated'] = class_exists( 'WC_Taxjar' ); return $settings; }