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
MobileApp.php
54 lines
| 1 | <?php |
| 2 | /** |
| 3 | * WooCommerce Admin Mobile App Note Provider. |
| 4 | * |
| 5 | * Adds a note to the merchant's inbox showing the benefits of 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 | * Mobile_App |
| 17 | */ |
| 18 | class MobileApp { |
| 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-mobile-app'; |
| 28 | |
| 29 | /** |
| 30 | * Get the note. |
| 31 | * |
| 32 | * @return Note |
| 33 | */ |
| 34 | public static function get_note() { |
| 35 | // We want to show the mobile app note after day 2. |
| 36 | $two_days_in_seconds = 2 * DAY_IN_SECONDS; |
| 37 | if ( ! self::is_wc_admin_active_in_date_range( 'week-1', $two_days_in_seconds ) ) { |
| 38 | return; |
| 39 | } |
| 40 | |
| 41 | $content = __( 'Install the WooCommerce mobile app to manage orders, receive sales notifications, and view key metrics — wherever you are.', 'woocommerce' ); |
| 42 | |
| 43 | $note = new Note(); |
| 44 | $note->set_title( __( 'Install Woo mobile app', 'woocommerce' ) ); |
| 45 | $note->set_content( $content ); |
| 46 | $note->set_content_data( (object) array() ); |
| 47 | $note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL ); |
| 48 | $note->set_name( self::NOTE_NAME ); |
| 49 | $note->set_source( 'woocommerce-admin' ); |
| 50 | $note->add_action( 'learn-more', __( 'Learn more', 'woocommerce' ), 'https://woocommerce.com/mobile/?utm_medium=product' ); |
| 51 | return $note; |
| 52 | } |
| 53 | } |
| 54 |