diff --git a/plugins/woocommerce/changelog/remove-update-store-details-note b/plugins/woocommerce/changelog/remove-update-store-details-note new file mode 100644 index 00000000000..45edb557672 --- /dev/null +++ b/plugins/woocommerce/changelog/remove-update-store-details-note @@ -0,0 +1,4 @@ +Significance: minor +Type: update + +Remove update store details note diff --git a/plugins/woocommerce/includes/class-wc-install.php b/plugins/woocommerce/includes/class-wc-install.php index e9b8f015ed3..54da7d2fd0e 100644 --- a/plugins/woocommerce/includes/class-wc-install.php +++ b/plugins/woocommerce/includes/class-wc-install.php @@ -830,6 +830,7 @@ class WC_Install { 'wc-admin-historical-data', 'wc-admin-review-shipping-settings', 'wc-admin-home-screen-feedback', + 'wc-admin-update-store-details', 'wc-admin-effortless-payments-by-mollie', 'wc-admin-google-ads-and-marketing', 'wc-admin-marketing-intro', diff --git a/plugins/woocommerce/src/Internal/Admin/Events.php b/plugins/woocommerce/src/Internal/Admin/Events.php index 1ede546c1e7..f4815f4b4f9 100644 --- a/plugins/woocommerce/src/Internal/Admin/Events.php +++ b/plugins/woocommerce/src/Internal/Admin/Events.php @@ -42,7 +42,6 @@ use \Automattic\WooCommerce\Internal\Admin\Notes\SellingOnlineCourses; use \Automattic\WooCommerce\Internal\Admin\Notes\TestCheckout; use \Automattic\WooCommerce\Internal\Admin\Notes\TrackingOptIn; use \Automattic\WooCommerce\Internal\Admin\Notes\UnsecuredReportFiles; -use \Automattic\WooCommerce\Internal\Admin\Notes\UpdateStoreDetails; use \Automattic\WooCommerce\Internal\Admin\Notes\WelcomeToWooCommerceForStoreUsers; use \Automattic\WooCommerce\Internal\Admin\Notes\WooCommercePayments; use \Automattic\WooCommerce\Internal\Admin\Notes\WooCommerceSubscriptions; @@ -99,7 +98,6 @@ class Events { RealTimeOrderAlerts::class, TestCheckout::class, TrackingOptIn::class, - UpdateStoreDetails::class, WooCommercePayments::class, WooCommerceSubscriptions::class, ); diff --git a/plugins/woocommerce/src/Internal/Admin/Notes/UpdateStoreDetails.php b/plugins/woocommerce/src/Internal/Admin/Notes/UpdateStoreDetails.php deleted file mode 100644 index f200333753b..00000000000 --- a/plugins/woocommerce/src/Internal/Admin/Notes/UpdateStoreDetails.php +++ /dev/null @@ -1,60 +0,0 @@ -set_title( __( 'Edit your store details if you need to', 'woocommerce' ) ); - $note->set_content( __( 'Nice work completing your store profile! You can always go back and edit the details you just shared, as needed.', 'woocommerce' ) ); - $note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL ); - $note->set_name( self::NOTE_NAME ); - $note->set_content_data( (object) array() ); - $note->set_source( 'woocommerce-admin' ); - $note->add_action( - 'update-store-details', - __( 'Update store details', 'woocommerce' ), - wc_admin_url( '&path=/setup-wizard' ) - ); - - return $note; - } -} diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/api/admin-notes.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/api/admin-notes.php index d53cc86b611..d582747369f 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/api/admin-notes.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/api/admin-notes.php @@ -218,79 +218,6 @@ class WC_Admin_Tests_API_Admin_Notes extends WC_REST_Unit_Test_Case { $this->assertEquals( 4, count( $notes ) ); } - /** - * Test getting notes when the user is in tasklist experiment returns notes of size `per_page` without any filters. - * - * @since 3.5.0 - */ - public function test_getting_notes_when_user_is_in_tasklist_experiment_returns_unfiltered_notes() { - // Given. - wp_set_current_user( $this->user ); - WC_Helper_Admin_Notes::reset_notes_dbs(); - // Notes of the following two names are hidden when the user is not in the task list experiment. - WC_Helper_Admin_Notes::add_note_for_test( 'wc-admin-complete-store-details' ); - WC_Helper_Admin_Notes::add_note_for_test( 'wc-admin-update-store-details' ); - // Other notes. - WC_Helper_Admin_Notes::add_note_for_test( 'winter-sales' ); - WC_Helper_Admin_Notes::add_note_for_test( '2022-promo' ); - - $this->set_user_in_tasklist_experiment(); - - // When. - $request = new WP_REST_Request( 'GET', $this->endpoint ); - $request->set_query_params( - array( - 'page' => '1', - 'per_page' => '3', - ) - ); - $response = $this->server->dispatch( $request ); - $notes = $response->get_data(); - - // Then. - $this->assertEquals( 200, $response->get_status() ); - $this->assertEquals( 3, count( $notes ) ); - $this->assertEquals( $notes[0]['name'], 'wc-admin-complete-store-details' ); - $this->assertEquals( $notes[1]['name'], 'wc-admin-update-store-details' ); - $this->assertEquals( $notes[2]['name'], 'winter-sales' ); - } - - /** - * Test getting notes when the user is not in tasklist experiment excludes two notes. - * @since 3.5.0 - */ - public function test_getting_notes_when_user_is_not_in_tasklist_experiment_excludes_two_notes() { - $this->markTestSkipped( 'We are disabling the experiments for now.' ); - // Given. - wp_set_current_user( $this->user ); - WC_Helper_Admin_Notes::reset_notes_dbs(); - // Notes of the following two names are hidden when the user is not in the task list experiment. - WC_Helper_Admin_Notes::add_note_for_test( 'wc-admin-complete-store-details' ); - WC_Helper_Admin_Notes::add_note_for_test( 'wc-admin-update-store-details' ); - // Other notes. - WC_Helper_Admin_Notes::add_note_for_test( 'summer-sales' ); - WC_Helper_Admin_Notes::add_note_for_test( '2022-promo' ); - - $this->set_user_out_of_tasklist_experiment(); - - // When. - $request = new WP_REST_Request( 'GET', $this->endpoint ); - $request->set_query_params( - array( - 'page' => '1', - 'per_page' => '3', - ) - ); - $response = $this->server->dispatch( $request ); - $notes = $response->get_data(); - - // Then. - $this->assertEquals( 200, $response->get_status() ); - $this->assertEquals( 2, count( $notes ) ); - $this->assertEquals( $notes[0]['name'], 'summer-sales' ); - $this->assertEquals( $notes[1]['name'], '2022-promo' ); - } - /** * Test getting notes of a certain type. * @@ -621,30 +548,4 @@ class WC_Admin_Tests_API_Admin_Notes extends WC_REST_Unit_Test_Case { $this->assertEquals( 200, $response->get_status() ); $this->assertEquals( 2, count( $notes ) ); } - - /** - * Simulates when the user is in tasklist experiment similar to `API/Notes` `is_tasklist_experiment_assigned_treatment` function. - */ - private function set_user_in_tasklist_experiment() { - // When the user is participating in either `wc-admin-complete-store-details` or `wc-admin-update-store-details` AB tests, - // the user is in tasklist experiment. - update_option( 'woocommerce_allow_tracking', 'yes' ); - $date = new \DateTime(); - $date->setTimeZone( new \DateTimeZone( 'UTC' ) ); - - $experiment_name = sprintf( - 'woocommerce_tasklist_progression_headercard_%s_%s', - $date->format( 'Y' ), - $date->format( 'm' ) - ); - set_transient( 'abtest_variation_' . $experiment_name, 'treatment' ); - } - - /** - * Simulates when the user is not in tasklist experiment similar to `API/Notes` `is_tasklist_experiment_assigned_treatment` function. - */ - private function set_user_out_of_tasklist_experiment() { - // Any experiment is off when `woocommerce_allow_tracking` option is false. - update_option( 'woocommerce_allow_tracking', false ); - } }