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
1 month ago
LaunchChecklist.php
2 years ago
MagentoMigration.php
2 years ago
ManageOrdersOnTheGo.php
2 years ago
MarketingJetpack.php
1 month ago
MigrateFromShopify.php
2 years ago
MobileApp.php
2 years ago
NewSalesRecord.php
3 years ago
NoteActionForbiddenException.php
1 month 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
PerformanceOnMobile.php
69 lines
| 1 | <?php |
| 2 | /** |
| 3 | * WooCommerce Admin Performance on mobile note. |
| 4 | * |
| 5 | * Adds a note to download the mobile app, performance on mobile. |
| 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 | * Performance_On_Mobile |
| 17 | */ |
| 18 | class PerformanceOnMobile { |
| 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-performance-on-mobile'; |
| 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 9 months old. |
| 36 | $nine_months_in_seconds = MONTH_IN_SECONDS * 9; |
| 37 | if ( ! self::wc_admin_active_for( $nine_months_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 | |
| 52 | $note = new Note(); |
| 53 | |
| 54 | $note->set_title( __( 'Track your store performance on mobile', 'woocommerce' ) ); |
| 55 | $note->set_content( __( 'Monitor your sales and high performing products with the Woo app.', 'woocommerce' ) ); |
| 56 | $note->set_content_data( (object) array() ); |
| 57 | $note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL ); |
| 58 | $note->set_name( self::NOTE_NAME ); |
| 59 | $note->set_source( 'woocommerce-admin' ); |
| 60 | $note->add_action( |
| 61 | 'learn-more', |
| 62 | __( 'Learn more', 'woocommerce' ), |
| 63 | 'https://woocommerce.com/mobile/?utm_source=inbox&utm_medium=product' |
| 64 | ); |
| 65 | |
| 66 | return $note; |
| 67 | } |
| 68 | } |
| 69 |