From 70f493523668925b7a444af3940c93d10dcc57c7 Mon Sep 17 00:00:00 2001 From: Gerhard Date: Wed, 27 Feb 2019 14:30:00 +0200 Subject: [PATCH] Fix logic to avoid setting to no again --- includes/admin/class-wc-admin-setup-wizard.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/includes/admin/class-wc-admin-setup-wizard.php b/includes/admin/class-wc-admin-setup-wizard.php index d3c7d442660..cdde2dbe559 100644 --- a/includes/admin/class-wc-admin-setup-wizard.php +++ b/includes/admin/class-wc-admin-setup-wizard.php @@ -576,12 +576,13 @@ class WC_Admin_Setup_Wizard { update_option( 'woocommerce_price_thousand_sep', $locale_info[ $country ]['thousand_sep'] ); } } - - if ( $tracking && 'unknown' === get_option( 'woocommerce_allow_tracking', 'unknown' ) ) { - update_option( 'woocommerce_allow_tracking', 'yes' ); - wp_schedule_single_event( time() + 10, 'woocommerce_tracker_send_event', array( true ) ); - } else { - update_option( 'woocommerce_allow_tracking', 'no' ); + if ( 'unknown' === get_option( 'woocommerce_allow_tracking', 'unknown' ) ) { + if ( $tracking ) { + update_option( 'woocommerce_allow_tracking', 'yes' ); + wp_schedule_single_event( time() + 10, 'woocommerce_tracker_send_event', array( true ) ); + } else { + update_option( 'woocommerce_allow_tracking', 'no' ); + } } WC_Install::create_pages();