PluginProbe
WooCommerce / 11.1.0
WooCommerce v11.1.0
11.1.0 11.1.0-rc.2 11.1.0-rc.1 11.1.0-beta.2 11.1.0-beta.1 11.0.1 11.0.0 11.0.0-rc.3 11.0.0-rc.2 11.0.0-rc.1 11.0.0-beta.2 11.0.0-beta.1 10.9.4 10.9.3 10.9.2 10.9.1 10.9.0 10.9.0-rc.1 10.9.0-beta.2 10.9.0-beta.1 10.8.1 10.8.0 10.8.0-rc.1 10.8.0-beta.2 10.8.0-beta.1 All 648 releases
woocommerce / src / Internal / Admin / Notes / EditProductsOnTheMove.php
EditProductsOnTheMove.php
72 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * WooCommerce Admin Edit products on the move note.
4 *
5 * Adds a note to download the mobile app.
6 */
7
8 namespace Automattic\WooCommerce\Internal\Admin\Notes;
9
10 defined( 'ABSPATH' ) || exit;
11
12 use Automattic\WooCommerce\Admin\Notes\Note;
13 use Automattic\WooCommerce\Admin\Notes\NoteTraits;
14
15 /**
16 * Edit_Products_On_The_Move
17 */
18 class EditProductsOnTheMove {
19 /**
20 * Note traits.
21 */
22 use NoteTraits;
23
24 /**
25 * Name of the note for use in the database.
26 */
27 const NOTE_NAME = 'wc-admin-edit-products-on-the-move';
28
29 /**
30 * Get the note.
31 *
32 * @return Note
33 */
34 public static function get_note() {
35 // Only add this note if this store is at least a year old.
36 $year_in_seconds = 365 * DAY_IN_SECONDS;
37 if ( ! self::wc_admin_active_for( $year_in_seconds ) ) {
38 return;
39 }
40
41 // Check that the previous mobile app notes have not been actioned.
42 if ( MobileApp::has_note_been_actioned() ) {
43 return;
44 }
45 if ( RealTimeOrderAlerts::has_note_been_actioned() ) {
46 return;
47 }
48 if ( ManageOrdersOnTheGo::has_note_been_actioned() ) {
49 return;
50 }
51 if ( PerformanceOnMobile::has_note_been_actioned() ) {
52 return;
53 }
54
55 $note = new Note();
56
57 $note->set_title( __( 'Edit products on the move', 'woocommerce' ) );
58 $note->set_content( __( 'Edit and create new products from your mobile devices with the Woo app', 'woocommerce' ) );
59 $note->set_content_data( (object) array() );
60 $note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
61 $note->set_name( self::NOTE_NAME );
62 $note->set_source( 'woocommerce-admin' );
63 $note->add_action(
64 'learn-more',
65 __( 'Learn more', 'woocommerce' ),
66 'https://woocommerce.com/mobile/?utm_source=inbox&utm_medium=product'
67 );
68
69 return $note;
70 }
71 }
72