OBW: Ensure tracker opt-in is always shown.

This commit is contained in:
Timmy Crawford 2019-03-27 15:29:55 -07:00
parent 4cad501098
commit 800ad318e3
1 changed files with 17 additions and 24 deletions

View File

@ -522,9 +522,6 @@ class WC_Admin_Setup_Wizard {
<?php esc_html_e( 'I will also be selling products or services in person.', 'woocommerce' ); ?>
</label>
<?php
if ( 'unknown' === get_option( 'woocommerce_allow_tracking', 'unknown' ) ) {
?>
<div class="woocommerce-tracker">
<p class="checkbox">
<input type="checkbox" id="wc_tracker_checkbox" name="wc_tracker_checkbox" value="yes" checked />
@ -537,9 +534,6 @@ class WC_Admin_Setup_Wizard {
?>
</p>
</div>
<?php
}
?>
<p class="wc-setup-actions step">
<button type="submit" class="button-primary button button-large button-next" value="<?php esc_attr_e( "Let's go!", 'woocommerce' ); ?>" name="save_step"><?php esc_html_e( "Let's go!", 'woocommerce' ); ?></button>
</p>
@ -587,14 +581,13 @@ class WC_Admin_Setup_Wizard {
update_option( 'woocommerce_price_thousand_sep', $locale_info[ $country ]['thousand_sep'] );
}
}
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();
wp_safe_redirect( esc_url_raw( $this->get_next_step_link() ) );