From 0fc1ec29fbebcdbc8486c93d4543ed8409f12d61 Mon Sep 17 00:00:00 2001 From: Fernando Date: Fri, 12 Jun 2020 15:49:41 -0300 Subject: [PATCH] Added new notification to choose a niche (https://github.com/woocommerce/woocommerce-admin/pull/4441) * Added new notification to choose a niche This commit adds a new notification to choose a niche # Conflicts: # src/Events.php * Bugfix: removed wrong validation * Added validation for onboarding_profile This commits adds a validation to confirm that the onboarding_profile is set. Co-authored-by: Fernando Marichal --- plugins/woocommerce-admin/src/Events.php | 2 + .../src/Notes/WC_Admin_Notes_Choose_Niche.php | 70 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Choose_Niche.php diff --git a/plugins/woocommerce-admin/src/Events.php b/plugins/woocommerce-admin/src/Events.php index 5a2812036d9..a8711f79861 100644 --- a/plugins/woocommerce-admin/src/Events.php +++ b/plugins/woocommerce-admin/src/Events.php @@ -10,6 +10,7 @@ namespace Automattic\WooCommerce\Admin; defined( 'ABSPATH' ) || exit; +use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Choose_Niche; use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Giving_Feedback_Notes; use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Mobile_App; use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_New_Sales_Record; @@ -90,6 +91,7 @@ class Events { WC_Admin_Notes_Learn_More_About_Product_Settings::possibly_add_note(); WC_Admin_Notes_Online_Clothing_Store::possibly_add_note(); WC_Admin_Notes_First_Product::possibly_add_note(); + WC_Admin_Notes_Choose_Niche::possibly_add_note(); WC_Admin_Notes_Real_Time_Order_Alerts::possibly_add_note(); if ( Loader::is_feature_enabled( 'remote-inbox-notifications' ) ) { diff --git a/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Choose_Niche.php b/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Choose_Niche.php new file mode 100644 index 00000000000..0d0780b73cd --- /dev/null +++ b/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Choose_Niche.php @@ -0,0 +1,70 @@ +set_title( __( 'How to choose a niche for your online store', 'woocommerce-admin' ) ); + $note->set_content( __( 'Your niche defines the products and services you develop. It directs your marketing. It focuses your attention on specific problems facing your customers. It differentiates you from the competition. Learn more about the five guiding principles to define your niche.', 'woocommerce-admin' ) ); + $note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL ); + $note->set_icon( 'info' ); + $note->set_name( self::NOTE_NAME ); + $note->set_content_data( (object) array() ); + $note->set_source( 'woocommerce-admin' ); + $note->add_action( + 'choose-niche', + __( 'Learn more', 'woocommerce-admin' ), + 'https://woocommerce.com/posts/how-to-choose-a-niche-online-business/?utm_source=inbox', + WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED, + true + ); + return $note; + } +}