CustomizeStoreWithBlocks.php
2 years ago
CustomizingProductCatalog.php
1 year ago
EUVATNumber.php
2 years ago
EditProductsOnTheMove.php
2 years ago
EmailImprovements.php
1 year ago
FirstProduct.php
1 year ago
GivingFeedbackNotes.php
3 years ago
InstallJPAndWCSPlugins.php
4 weeks ago
LaunchChecklist.php
2 years ago
MagentoMigration.php
2 years ago
ManageOrdersOnTheGo.php
2 years ago
MarketingJetpack.php
4 weeks ago
MigrateFromShopify.php
2 years ago
MobileApp.php
2 years ago
NewSalesRecord.php
3 years ago
NoteActionForbiddenException.php
4 weeks ago
OnboardingPayments.php
2 years ago
OnlineClothingStore.php
2 years ago
OrderMilestones.php
2 years ago
PaymentsMoreInfoNeeded.php
5 months ago
PaymentsRemindMeLater.php
5 months ago
PerformanceOnMobile.php
2 years ago
PersonalizeStore.php
3 years ago
RealTimeOrderAlerts.php
2 years ago
ScheduledUpdatesPromotion.php
5 months ago
SellingOnlineCourses.php
2 years ago
TrackingOptIn.php
1 year ago
UnsecuredReportFiles.php
2 years ago
WooCommercePayments.php
2 years ago
WooCommerceSubscriptions.php
2 years ago
WooSubscriptionsNotes.php
1 year ago
RealTimeOrderAlerts.php
58 lines
| 1 | <?php |
| 2 | /** |
| 3 | * WooCommerce Admin Real Time Order Alerts Note. |
| 4 | * |
| 5 | * Adds a note to download the mobile app to monitor store activity. |
| 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 | * Real_Time_Order_Alerts |
| 17 | */ |
| 18 | class RealTimeOrderAlerts { |
| 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-real-time-order-alerts'; |
| 28 | |
| 29 | /** |
| 30 | * Get the note. |
| 31 | * |
| 32 | * @return Note |
| 33 | */ |
| 34 | public static function get_note() { |
| 35 | // Only add this note if the store is 3 months old. |
| 36 | if ( ! self::is_wc_admin_active_in_date_range( 'month-3-6' ) ) { |
| 37 | return; |
| 38 | } |
| 39 | |
| 40 | // Check that the previous mobile app note was not actioned. |
| 41 | if ( MobileApp::has_note_been_actioned() ) { |
| 42 | return; |
| 43 | } |
| 44 | |
| 45 | $content = __( 'Get notifications about store activity, including new orders and product reviews directly on your mobile devices with the Woo app.', 'woocommerce' ); |
| 46 | |
| 47 | $note = new Note(); |
| 48 | $note->set_title( __( 'Get real-time order alerts anywhere', 'woocommerce' ) ); |
| 49 | $note->set_content( $content ); |
| 50 | $note->set_content_data( (object) array() ); |
| 51 | $note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL ); |
| 52 | $note->set_name( self::NOTE_NAME ); |
| 53 | $note->set_source( 'woocommerce-admin' ); |
| 54 | $note->add_action( 'learn-more', __( 'Learn more', 'woocommerce' ), 'https://woocommerce.com/mobile/?utm_source=inbox&utm_medium=product' ); |
| 55 | return $note; |
| 56 | } |
| 57 | } |
| 58 |