2020-06-12 08:01:06 +00:00
< ? php
/**
* WooCommerce Admin Real Time Order Alerts Note .
*
* Adds a note to download the mobile app to monitor store activity .
*/
namespace Automattic\WooCommerce\Admin\Notes ;
defined ( 'ABSPATH' ) || exit ;
/**
2020-09-28 04:35:10 +00:00
* Real_Time_Order_Alerts
2020-06-12 08:01:06 +00:00
*/
2020-10-28 17:12:14 +00:00
class RealTimeOrderAlerts {
2020-06-12 08:01:06 +00:00
/**
* Note traits .
*/
use NoteTraits ;
/**
* Name of the note for use in the database .
*/
const NOTE_NAME = 'wc-admin-real-time-order-alerts' ;
/**
* Get the note .
2020-09-28 04:35:10 +00:00
*
* @ return Note
2020-06-12 08:01:06 +00:00
*/
public static function get_note () {
// Only add this note if the store is 3 months old.
2021-06-24 14:32:02 +00:00
if ( ! self :: is_wc_admin_active_in_date_range ( 'month-3-6' ) ) {
2020-06-12 08:01:06 +00:00
return ;
}
// Check that the previous mobile app note was not actioned.
2020-11-16 21:39:36 +00:00
if ( MobileApp :: has_note_been_actioned () ) {
2020-09-07 23:01:12 +00:00
return ;
2020-06-12 08:01:06 +00:00
}
$content = __ ( 'Get notifications about store activity, including new orders and product reviews directly on your mobile devices with the Woo app.' , 'woocommerce-admin' );
2020-09-28 04:35:10 +00:00
$note = new Note ();
2020-06-12 08:01:06 +00:00
$note -> set_title ( __ ( 'Get real-time order alerts anywhere' , 'woocommerce-admin' ) );
$note -> set_content ( $content );
$note -> set_content_data ( ( object ) array () );
2020-09-28 04:35:10 +00:00
$note -> set_type ( Note :: E_WC_ADMIN_NOTE_INFORMATIONAL );
2020-06-12 08:01:06 +00:00
$note -> set_name ( self :: NOTE_NAME );
$note -> set_source ( 'woocommerce-admin' );
2021-08-03 20:56:43 +00:00
$note -> add_action ( 'learn-more' , __ ( 'Learn more' , 'woocommerce-admin' ), 'https://woocommerce.com/mobile/?utm_source=inbox&utm_medium=product' );
2020-06-12 08:01:06 +00:00
return $note ;
}
}