diff --git a/plugins/woocommerce-admin/src/Events.php b/plugins/woocommerce-admin/src/Events.php index 342ef1ac9bc..963922c0f77 100644 --- a/plugins/woocommerce-admin/src/Events.php +++ b/plugins/woocommerce-admin/src/Events.php @@ -26,6 +26,7 @@ use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Migrate_From_Shopify; use \Automattic\WooCommerce\Admin\RemoteInboxNotifications\DataSourcePoller; use \Automattic\WooCommerce\Admin\RemoteInboxNotifications\RemoteInboxNotificationsEngine; use \Automattic\WooCommerce\Admin\Loader; +use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Learn_More_About_Product_Settings; use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Online_Clothing_Store; use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_First_Product; @@ -85,6 +86,7 @@ class Events { WC_Admin_Notes_Start_Dropshipping_Business::possibly_add_note(); WC_Admin_Notes_WooCommerce_Subscriptions::possibly_add_note(); WC_Admin_Notes_Migrate_From_Shopify::possibly_add_note(); + 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(); diff --git a/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Learn_More_About_Product_Settings.php b/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Learn_More_About_Product_Settings.php new file mode 100644 index 00000000000..05c4a569098 --- /dev/null +++ b/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Learn_More_About_Product_Settings.php @@ -0,0 +1,84 @@ + 1, + 'status' => 'publish', + 'orderby' => 'date', + 'order' => 'ASC', + ) + ); + $products = $query->get_products(); + if ( 0 === count( $products ) ) { + return; + } + $oldest_product_timestamp = $products[0]->get_date_created()->getTimestamp(); + if ( ( time() - $oldest_product_timestamp ) < DAY_IN_SECONDS ) { + return; + } + + $note = new WC_Admin_Note(); + $note->set_title( __( 'Learn more about Product Settings', 'woocommerce-admin' ) ); + $note->set_content( __( 'In this video you\'ll find information about configuring product settings, such as how they are displayed, editing inventory options and so on.', 'woocommerce-admin' ) ); + $note->set_type( WC_Admin_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( + 'learn-more-about-product-settings', + __( 'Watch tutorial', 'woocommerce-admin' ), + 'https://www.youtube.com/watch?v=FEmwJsE8xDY&t=', + WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED, + true + ); + return $note; + } +}