diff --git a/plugins/woocommerce-admin/client/stylesheets/shared/_embed.scss b/plugins/woocommerce-admin/client/stylesheets/shared/_embed.scss index ff30df16e45..a62187854fe 100644 --- a/plugins/woocommerce-admin/client/stylesheets/shared/_embed.scss +++ b/plugins/woocommerce-admin/client/stylesheets/shared/_embed.scss @@ -114,7 +114,7 @@ } .woocommerce-activity-card__actions { - a.components-button.is-button { + a.components-button.is-button:not(.is-primary) { color: $gray-text; } } diff --git a/plugins/woocommerce-admin/client/stylesheets/shared/_global.scss b/plugins/woocommerce-admin/client/stylesheets/shared/_global.scss index 5bcb0629074..a2566435ea3 100644 --- a/plugins/woocommerce-admin/client/stylesheets/shared/_global.scss +++ b/plugins/woocommerce-admin/client/stylesheets/shared/_global.scss @@ -68,7 +68,7 @@ } } - .components-button.is-button.is-default { + .components-button.is-button.is-default:not(.is-primary) { color: $gray-text; border-color: $button-border; background: $button; @@ -85,7 +85,7 @@ } } - .components-button.is-default:disabled { + .components-button.is-default:disabled:not(.is-primary) { color: $button-disabled; border-color: $button-disabled-border; background: $button; diff --git a/plugins/woocommerce-admin/src/Events.php b/plugins/woocommerce-admin/src/Events.php index 9dd40352df2..3654221acb0 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_Add_First_Product; use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Facebook_Extension; use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Giving_Feedback_Notes; use \Automattic\WooCommerce\Admin\Notes\WC_Admin_Notes_Mobile_App; @@ -62,5 +63,6 @@ class Events { WC_Admin_Notes_Giving_Feedback_Notes::add_notes_for_admin_giving_feedback(); WC_Admin_Notes_Mobile_App::possibly_add_mobile_app_note(); WC_Admin_Notes_Facebook_Extension::possibly_add_facebook_note(); + WC_Admin_Notes_Add_First_Product::possibly_add_first_product_note(); } } diff --git a/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Add_First_Product.php b/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Add_First_Product.php new file mode 100644 index 00000000000..33f6721d7e8 --- /dev/null +++ b/plugins/woocommerce-admin/src/Notes/WC_Admin_Notes_Add_First_Product.php @@ -0,0 +1,56 @@ +publish ) { + return; + } + + $data_store = \WC_Data_Store::load( 'admin-note' ); + + // We already have this note? Then exit, we're done. + $note_ids = $data_store->get_notes_with_name( self::NOTE_NAME ); + if ( ! empty( $note_ids ) ) { + return; + } + + $content = __( 'Grow your revenue by adding products to your store. Add products manually, import from a sheet, or migrate from another platform.', 'woocommerce-admin' ); + + $note = new WC_Admin_Note(); + $note->set_title( __( 'Add your first product', 'woocommerce-admin' ) ); + $note->set_content( $content ); + $note->set_content_data( (object) array() ); + $note->set_type( WC_Admin_Note::E_WC_ADMIN_NOTE_INFORMATIONAL ); + $note->set_icon( 'product' ); + $note->set_name( self::NOTE_NAME ); + $note->set_source( 'woocommerce-admin' ); + $note->add_action( 'add-a-product', __( 'Add a product', 'woocommerce-admin' ), admin_url( 'post-new.php?post_type=product' ), WC_Admin_Note::E_WC_ADMIN_NOTE_ACTIONED, true ); + + $note->save(); + } +}