Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/woocomme.../src/Internal/Admin/Notes
File: PersonalizeStore.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WooCommerce Admin Personalize Your Store Note Provider.
[2] Fix | Delete
*
[3] Fix | Delete
* Adds a note to the merchant's inbox prompting them to personalize their store.
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
namespace Automattic\WooCommerce\Internal\Admin\Notes;
[7] Fix | Delete
[8] Fix | Delete
defined( 'ABSPATH' ) || exit;
[9] Fix | Delete
[10] Fix | Delete
use Automattic\WooCommerce\Admin\Notes\Note;
[11] Fix | Delete
use Automattic\WooCommerce\Admin\Notes\NoteTraits;
[12] Fix | Delete
[13] Fix | Delete
/**
[14] Fix | Delete
* Personalize_Store
[15] Fix | Delete
*/
[16] Fix | Delete
class PersonalizeStore {
[17] Fix | Delete
/**
[18] Fix | Delete
* Note traits.
[19] Fix | Delete
*/
[20] Fix | Delete
use NoteTraits;
[21] Fix | Delete
[22] Fix | Delete
/**
[23] Fix | Delete
* Name of the note for use in the database.
[24] Fix | Delete
*/
[25] Fix | Delete
const NOTE_NAME = 'wc-admin-personalize-store';
[26] Fix | Delete
[27] Fix | Delete
/**
[28] Fix | Delete
* Get the note.
[29] Fix | Delete
*
[30] Fix | Delete
* @return Note
[31] Fix | Delete
*/
[32] Fix | Delete
public static function get_note() {
[33] Fix | Delete
// Only show the note to stores with homepage.
[34] Fix | Delete
$homepage_id = get_option( 'woocommerce_onboarding_homepage_post_id', false );
[35] Fix | Delete
if ( ! $homepage_id ) {
[36] Fix | Delete
return;
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
// Show the note after task list is done.
[40] Fix | Delete
$is_task_list_complete = get_option( 'woocommerce_task_list_complete', false );
[41] Fix | Delete
[42] Fix | Delete
// We want to show the note after day 5.
[43] Fix | Delete
$five_days_in_seconds = 5 * DAY_IN_SECONDS;
[44] Fix | Delete
[45] Fix | Delete
if ( ! self::is_wc_admin_active_in_date_range( 'week-1-4', $five_days_in_seconds ) && ! $is_task_list_complete ) {
[46] Fix | Delete
return;
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
$content = __( 'The homepage is one of the most important entry points in your store. When done right it can lead to higher conversions and engagement. Don\'t forget to personalize the homepage that we created for your store during the onboarding.', 'woocommerce' );
[50] Fix | Delete
[51] Fix | Delete
$note = new Note();
[52] Fix | Delete
$note->set_title( __( 'Personalize your store\'s homepage', 'woocommerce' ) );
[53] Fix | Delete
$note->set_content( $content );
[54] Fix | Delete
$note->set_content_data( (object) array() );
[55] Fix | Delete
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
[56] Fix | Delete
$note->set_name( self::NOTE_NAME );
[57] Fix | Delete
$note->set_source( 'woocommerce-admin' );
[58] Fix | Delete
$note->add_action( 'personalize-homepage', __( 'Personalize homepage', 'woocommerce' ), admin_url( 'post.php?post=' . $homepage_id . '&action=edit' ), Note::E_WC_ADMIN_NOTE_ACTIONED );
[59] Fix | Delete
return $note;
[60] Fix | Delete
}
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function