2021-01-07 06:39:04 +00:00
< ? php
/**
* WooCommerce Admin : Insight - First product and payment setup
*
* Adds a note to give insight about the first product and payment setup
*
* @ package WooCommerce\Admin
*/
namespace Automattic\WooCommerce\Admin\Notes ;
defined ( 'ABSPATH' ) || exit ;
/**
* Insight_First_Sale .
*/
class InsightFirstProductAndPayment {
/**
* Note traits .
*/
use NoteTraits ;
/**
* Name of the note for use in the database .
*/
const NOTE_NAME = 'wc-admin-insight-first-product-and-payment' ;
/**
* Get the note .
*
* @ return Note
*/
public static function get_note () {
// We want to show the note after 1 day.
if ( ! self :: wc_admin_active_for ( DAY_IN_SECONDS ) ) {
return ;
}
$note = new Note ();
$note -> set_title ( __ ( 'Insight' , 'woocommerce-admin' ) );
2021-03-17 09:14:47 +00:00
$note -> set_content ( __ ( 'More than 80% of new merchants add the first product and have at least one payment method set up during the first week.<br><br>Do you find this type of insight useful?' , 'woocommerce-admin' ) );
2021-01-07 06:39:04 +00:00
$note -> set_type ( Note :: E_WC_ADMIN_NOTE_SURVEY );
$note -> set_name ( self :: NOTE_NAME );
$note -> set_content_data ( ( object ) array () );
$note -> set_source ( 'woocommerce-admin' );
$note -> add_action (
'affirm-insight-first-product-and-payment' ,
__ ( 'Yes' , 'woocommerce-admin' ),
false ,
Note :: E_WC_ADMIN_NOTE_ACTIONED ,
false ,
__ ( 'Thanks for your feedback' , 'woocommerce-admin' )
);
2021-03-17 09:14:47 +00:00
$note -> add_action (
'affirm-insight-first-product-and-payment' ,
__ ( 'No' , 'woocommerce-admin' ),
false ,
Note :: E_WC_ADMIN_NOTE_ACTIONED ,
false ,
__ ( 'Thanks for your feedback' , 'woocommerce-admin' )
2021-03-30 23:43:34 +00:00
);
2021-03-17 09:14:47 +00:00
2021-01-07 06:39:04 +00:00
return $note ;
}
}