Display WCPay task when installed via subscriptions option on profiler (https://github.com/woocommerce/woocommerce-admin/pull/8445)

This commit is contained in:
Joel Thiessen 2022-03-14 12:44:55 -07:00 committed by GitHub
parent 4ec162bab0
commit 8465c10917
3 changed files with 20 additions and 1 deletions

View File

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

View File

@ -0,0 +1,4 @@
Significance: minor
Type: Update
Display WCPay task when installed via subscriptions option on profiler

View File

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