* Add a new note for the theme marketplace
This commit is contained in:
Moon 2021-01-06 22:49:29 -08:00 committed by GitHub
parent ef4d8a0339
commit 058e222607
3 changed files with 55 additions and 0 deletions

View File

@ -9,6 +9,7 @@ namespace Automattic\WooCommerce\Admin;
defined( 'ABSPATH' ) || exit;
use \Automattic\WooCommerce\Admin\Notes\ChooseNiche;
use \Automattic\WooCommerce\Admin\Notes\ChoosingTheme;
use \Automattic\WooCommerce\Admin\Notes\GivingFeedbackNotes;
use \Automattic\WooCommerce\Admin\Notes\InsightFirstProductAndPayment;
use \Automattic\WooCommerce\Admin\Notes\MobileApp;
@ -114,6 +115,7 @@ class Events {
NavigationFeedback::possibly_add_note();
NavigationFeedbackFollowUp::possibly_add_note();
FilterByProductVariationsInReports::possibly_add_note();
ChoosingTheme::possibly_add_note();
InsightFirstProductAndPayment::possibly_add_note();
if ( $this->is_remote_inbox_notifications_enabled() ) {

View File

@ -7,6 +7,7 @@ namespace Automattic\WooCommerce\Admin;
defined( 'ABSPATH' ) || exit;
use \Automattic\WooCommerce\Admin\Notes\ChoosingTheme;
use \Automattic\WooCommerce\Admin\Notes\InsightFirstProductAndPayment;
use \Automattic\WooCommerce\Admin\Notes\Notes;
use \Automattic\WooCommerce\Admin\Notes\OrderMilestones;

View File

@ -0,0 +1,52 @@
<?php
/**
* WooCommerce Admin (Dashboard) choosing a theme note
*
* Adds notes to the merchant's inbox about choosing a theme.
*/
namespace Automattic\WooCommerce\Admin\Notes;
defined( 'ABSPATH' ) || exit;
/**
* Giving_Feedback_Notes
*/
class ChoosingTheme {
/**
* Note traits.
*/
use NoteTraits;
/**
* Name of the note for use in the database.
*/
const NOTE_NAME = 'wc-admin-choosing-a-theme';
/**
* Get the note.
*
* @return Note
*/
protected static function get_note() {
// We need to show choosing a theme notification after 1 day of install.
if ( ! self::wc_admin_active_for( DAY_IN_SECONDS ) ) {
return;
}
// Otherwise, create our new note.
$note = new Note();
$note->set_title( __( 'Choosing a theme?', 'woocommerce-admin' ) );
$note->set_content( __( 'Check out the themes that are compatible with WooCommerce and choose one aligned with your brand and business needs.', 'woocommerce-admin' ) );
$note->set_content_data( (object) array() );
$note->set_type( Note::E_WC_ADMIN_NOTE_MARKETING );
$note->set_name( self::NOTE_NAME );
$note->set_source( 'woocommerce-admin' );
$note->add_action(
'visit-the-theme-marketplace',
__( 'Visit the theme marketplace', 'woocommerce-admin' ),
'https://woocommerce.com/product-category/themes/?utm_source=inbox'
);
return $note;
}
}