diff --git a/class-wc-calypso-bridge.php b/class-wc-calypso-bridge.php index 15f68bf2..6c805ad1 100644 --- a/class-wc-calypso-bridge.php +++ b/class-wc-calypso-bridge.php @@ -187,6 +187,7 @@ public function includes() { require_once WC_CALYPSO_BRIDGE_PLUGIN_PATH . '/includes/free-trial/partners/class-wc-calypso-bridge-partner-stripe.php'; require_once WC_CALYPSO_BRIDGE_PLUGIN_PATH . '/includes/free-trial/partners/class-wc-calypso-bridge-partner-paypal.php'; require_once WC_CALYPSO_BRIDGE_PLUGIN_PATH . '/includes/class-wc-calypso-bridge-coming-soon.php'; + require_once WC_CALYPSO_BRIDGE_PLUGIN_PATH . '/includes/class-wc-calypso-bridge-admin-settings.php'; // Experiments. require_once WC_CALYPSO_BRIDGE_PLUGIN_PATH . '/includes/experiments/class-wc-calypso-bridge-task-list-reminderbar-experiment.php'; diff --git a/includes/class-wc-calypso-bridge-admin-settings.php b/includes/class-wc-calypso-bridge-admin-settings.php new file mode 100644 index 00000000..76f8b7d7 --- /dev/null +++ b/includes/class-wc-calypso-bridge-admin-settings.php @@ -0,0 +1,64 @@ +hook_update_option_woocommerce_coming_soon(); + add_filter( 'option_woocommerce_coming_soon', array( $this, 'possibly_disable_lys_coming_soon' ), 10 ); } /** @@ -63,7 +64,8 @@ public function unhook_update_option_woocommerce_coming_soon() { */ public function should_show_a8c_coming_soon_page( $should_show ) { if ( - class_exists( '\Automattic\WooCommerce\Admin\Features\Features' ) && \Automattic\WooCommerce\Admin\Features\Features::is_enabled( 'launch-your-store' ) + class_exists( '\Automattic\WooCommerce\Admin\Features\Features' ) && \Automattic\WooCommerce\Admin\Features\Features::is_enabled( 'launch-your-store' ) && + ! wc_calypso_bridge_is_ecommerce_trial_plan() ) { return false; } @@ -178,6 +180,20 @@ public function add_admin_notice( $message, $notice_type = 'info' ) { tasks[$index] ); break; + case 'launch-your-store': + if ( wc_calypso_bridge_is_ecommerce_trial_plan() ){ + // Remove launch your store task. + unset( $lists['setup']->tasks[$index] ); + } + break; } } diff --git a/includes/class-wc-calypso-bridge-woocommerce-admin-features.php b/includes/class-wc-calypso-bridge-woocommerce-admin-features.php index 46a29e31..67076677 100644 --- a/includes/class-wc-calypso-bridge-woocommerce-admin-features.php +++ b/includes/class-wc-calypso-bridge-woocommerce-admin-features.php @@ -140,10 +140,7 @@ public function filter_wc_admin_enabled_features( $features ) { * @return array */ public function filter_woocommerce_admin_features( $features ) { - // Disable launch-your-store to prevent clashes with similar functionality already provided. - if ( isset( $features['launch-your-store'] ) ) { - $features['launch-your-store'] = false; - } + // The rest applies only to Entrepreneur and Woo Express plans. if ( ! wc_calypso_bridge_has_ecommerce_features() ) {