2020-05-11 06:14:37 +00:00
< ? php
/**
* WooCommerce Admin ( Dashboard ) Giving feedback notes provider
*
* Adds notes to the merchant ' s inbox about giving feedback .
*/
namespace Automattic\WooCommerce\Admin\Notes ;
defined ( 'ABSPATH' ) || exit ;
2022-02-17 19:14:23 +00:00
use Automattic\WooCommerce\Internal\Admin\Survey ;
2021-01-15 14:54:26 +00:00
2020-05-11 06:14:37 +00:00
/**
2020-09-28 04:35:10 +00:00
* Giving_Feedback_Notes
2020-05-11 06:14:37 +00:00
*/
2020-10-28 17:12:14 +00:00
class GivingFeedbackNotes {
2020-05-11 06:14:37 +00:00
/**
* Note traits .
*/
use NoteTraits ;
/**
2020-05-22 13:48:40 +00:00
* Name of the note for use in the database .
2020-05-11 06:14:37 +00:00
*/
2020-05-22 13:48:40 +00:00
const NOTE_NAME = 'wc-admin-store-notice-giving-feedback-2' ;
2020-05-11 06:14:37 +00:00
/**
2020-05-22 13:48:40 +00:00
* Get the note .
2020-09-28 04:35:10 +00:00
*
* @ return Note
2020-05-11 06:14:37 +00:00
*/
2020-05-22 13:48:40 +00:00
protected static function get_note () {
2021-05-13 12:41:21 +00:00
if ( ! self :: is_wc_admin_active_in_date_range ( 'week-1-4' ) ) {
2020-05-11 06:14:37 +00:00
return ;
}
// Otherwise, create our new note.
2020-09-28 04:35:10 +00:00
$note = new Note ();
2021-01-07 06:42:26 +00:00
$note -> set_title ( __ ( 'You\'re invited to share your experience' , 'woocommerce-admin' ) );
2020-05-11 06:14:37 +00:00
$note -> set_content ( __ ( 'Now that you’ ve chosen us as a partner, our goal is to make sure we\'re providing the right tools to meet your needs. We\'re looking forward to having your feedback on the store setup experience so we can improve it in the future.' , 'woocommerce-admin' ) );
$note -> set_content_data ( ( object ) array () );
2020-09-28 04:35:10 +00:00
$note -> set_type ( Note :: E_WC_ADMIN_NOTE_INFORMATIONAL );
2020-05-22 13:48:40 +00:00
$note -> set_name ( self :: NOTE_NAME );
2020-05-11 06:14:37 +00:00
$note -> set_source ( 'woocommerce-admin' );
$note -> add_action (
'share-feedback' ,
__ ( 'Share feedback' , 'woocommerce-admin' ),
2021-01-15 14:54:26 +00:00
Survey :: get_url ( '/store-setup-survey' )
2020-05-11 06:14:37 +00:00
);
2020-05-22 13:48:40 +00:00
return $note ;
2020-05-11 06:14:37 +00:00
}
}