From 8465c109171f954ebf2859c8f89929e322d78aa9 Mon Sep 17 00:00:00 2001 From: Joel Thiessen <444632+joelclimbsthings@users.noreply.github.com> Date: Mon, 14 Mar 2022 12:44:55 -0700 Subject: [PATCH] Display WCPay task when installed via subscriptions option on profiler (https://github.com/woocommerce/woocommerce-admin/pull/8445) --- plugins/woocommerce-admin/TESTING-INSTRUCTIONS.md | 12 ++++++++++++ plugins/woocommerce-admin/changelogs/update-8240 | 4 ++++ .../OnboardingTasks/Tasks/WooCommercePayments.php | 5 ++++- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 plugins/woocommerce-admin/changelogs/update-8240 diff --git a/plugins/woocommerce-admin/TESTING-INSTRUCTIONS.md b/plugins/woocommerce-admin/TESTING-INSTRUCTIONS.md index 95688e7caf0..6edecc6d125 100644 --- a/plugins/woocommerce-admin/TESTING-INSTRUCTIONS.md +++ b/plugins/woocommerce-admin/TESTING-INSTRUCTIONS.md @@ -2,6 +2,18 @@ ## Unreleased +### Display WCPay task when installed via subscriptions option on profiler + +1. Start with a fresh install. +2. Navigate to WooCommerce -> Home to start the OBW. +3. Ensure you select "subscriptions" under the step for product types. +4. Complete the rest of the onboarding wizard. +5. Confirm that "Get paid with WooCommerce Payments" appears under primary task list. +6. When clicked, it should redirect to WCPay connection page. +7. Set up/connect WooCommerce Payments. +8. After WCPay is connected, go to the Homescreen and confirm that "Set up additional payment providers" appears under extended task list. +9. When clicked, it should direct to the payments task. + ## 3.3.0 ### Prompt a modal to save any unsaved changes in OBW diff --git a/plugins/woocommerce-admin/changelogs/update-8240 b/plugins/woocommerce-admin/changelogs/update-8240 new file mode 100644 index 00000000000..a46e5ccd0ac --- /dev/null +++ b/plugins/woocommerce-admin/changelogs/update-8240 @@ -0,0 +1,4 @@ +Significance: minor +Type: Update + +Display WCPay task when installed via subscriptions option on profiler diff --git a/plugins/woocommerce-admin/src/Features/OnboardingTasks/Tasks/WooCommercePayments.php b/plugins/woocommerce-admin/src/Features/OnboardingTasks/Tasks/WooCommercePayments.php index e22664fa7bb..ccbc2ed0d1b 100644 --- a/plugins/woocommerce-admin/src/Features/OnboardingTasks/Tasks/WooCommercePayments.php +++ b/plugins/woocommerce-admin/src/Features/OnboardingTasks/Tasks/WooCommercePayments.php @@ -107,8 +107,11 @@ class WooCommercePayments extends Task { */ public static function is_requested() { $profiler_data = get_option( Onboarding::PROFILE_DATA_OPTION, array() ); + $product_types = isset( $profiler_data['product_types'] ) ? $profiler_data['product_types'] : array(); $business_extensions = isset( $profiler_data['business_extensions'] ) ? $profiler_data['business_extensions'] : array(); - return in_array( 'woocommerce-payments', $business_extensions, true ); + + $subscriptions_and_us = in_array( 'subscriptions', $product_types, true ) && 'US' === WC()->countries->get_base_country(); + return in_array( 'woocommerce-payments', $business_extensions, true ) || $subscriptions_and_us; } /**