Skip to content

Commit

Permalink
Update trial plan checks
Browse files Browse the repository at this point in the history
  • Loading branch information
chihsuan committed Sep 3, 2024
1 parent f71ade4 commit 18f7d65
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion includes/class-wc-calypso-bridge-admin-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ final public static function get_instance() {
* Constructor.
*/
public function __construct() {
if ( ! is_admin() ) {
return;
}

add_filter( 'woocommerce_settings_tabs_array', array( $this, 'replace_settings_tab' ), PHP_INT_MAX );
}

Expand All @@ -47,7 +51,7 @@ public function __construct() {
public function replace_settings_tab( $tabs ) {
global $current_tab;

if ( wc_calypso_bridge_is_ecommerce_trial_plan() ) {
if ( wc_calypso_bridge_is_trial_plan() ) {
// Remove Site Visibility setting for the free trial plan.
unset( $tabs['site-visibility'] );

Expand Down
2 changes: 1 addition & 1 deletion includes/class-wc-calypso-bridge-coming-soon.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function should_exclude_lys_coming_soon( $exclude ) {
*/
public function override_option_woocommerce_coming_soon( $current_value ) {
// Turn off coming soon mode for trial plan.
if ( wc_calypso_bridge_is_ecommerce_trial_plan() ) {
if ( wc_calypso_bridge_is_trial_plan() ) {
return 'no';
}

Expand Down
4 changes: 2 additions & 2 deletions includes/class-wc-calypso-bridge-setup-tasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ public function replace_tasks( $lists ) {
unset( $lists['setup']->tasks[$index] );
break;
case 'launch-your-store':
if ( wc_calypso_bridge_is_ecommerce_trial_plan() ){
// Remove launch your store task.
if ( wc_calypso_bridge_is_trial_plan() ) {
// Don't show launch your store task for trial sites.
unset( $lists['setup']->tasks[$index] );
}
break;
Expand Down

0 comments on commit 18f7d65

Please sign in to comment.