Add new note for the theme marketplace (https://github.com/woocommerce/woocommerce-admin/pull/6016)
* Add a new note for the theme marketplace
This commit is contained in:
parent
ef4d8a0339
commit
058e222607
|
@ -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() ) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue