* Add note to confirm automated tax settings

* add back automated_tax_is_supported function

* Trigger CI

Co-authored-by: Rebecca Scott <me@becdetat.com>
This commit is contained in:
Bec Scott 2020-10-08 09:12:31 +10:00 committed by GitHub
parent 51867b3d3b
commit 1c009dd9e7
2 changed files with 50 additions and 0 deletions

View File

@ -8,6 +8,7 @@
namespace Automattic\WooCommerce\Admin\Features; namespace Automattic\WooCommerce\Admin\Features;
use Automattic\WooCommerce\Admin\Features\OnboardingTasks; use Automattic\WooCommerce\Admin\Features\OnboardingTasks;
use Automattic\WooCommerce\Admin\Notes\Confirm_Tax_Settings;
/** /**
* This contains logic for setting up shipping when the profiler completes. * This contains logic for setting up shipping when the profiler completes.
@ -58,6 +59,7 @@ class OnboardingAutomateTaxes {
if ( $jetpack_connected && $wcs_version && $wcs_tos_accepted ) { if ( $jetpack_connected && $wcs_version && $wcs_tos_accepted ) {
update_option( 'wc_connect_taxes_enabled', 'yes' ); update_option( 'wc_connect_taxes_enabled', 'yes' );
update_option( 'woocommerce_calc_taxes', 'yes' ); update_option( 'woocommerce_calc_taxes', 'yes' );
Confirm_Tax_Settings::possibly_add_note();
} }
} }

View File

@ -0,0 +1,48 @@
<?php
/**
* WooCommerce Admin: Confirm tax settings
*
* Adds a note to ask the user to confirm tax settings after automated taxes
* has been automatically enabled (see OnboardingAutomateTaxes).
*/
namespace Automattic\WooCommerce\Admin\Notes;
defined( 'ABSPATH' ) || exit;
/**
* ConfirmTaxSettings.
*/
class Confirm_Tax_Settings {
/**
* Note traits.
*/
use NoteTraits;
/**
* Name of the note for use in the database.
*/
const NOTE_NAME = 'wc-admin-confirm-tax-settings';
/**
* Get the note.
*
* @return Note
*/
public static function get_note() {
$note = new Note();
$note->set_title( __( 'Confirm tax settings', 'woocommerce-admin' ) );
$note->set_content( __( 'Automated tax calculations are enabled on your store through WooCommerce Services. Learn more about automated taxes <a href="https://docs.woocommerce.com/document/woocommerce-services/#section-12">here</a>.', 'woocommerce-admin' ) );
$note->set_source( 'woocommerce-admin' );
$note->add_action(
'confirm-tax-settings_edit-tax-settings',
__( 'Edit tax settings', 'woocommerce-admin' ),
admin_url( 'admin.php?page=wc-settings&tab=tax' ),
Note::E_WC_ADMIN_NOTE_UNACTIONED,
true
);
return $note;
}
}