Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/woocomme.../src/Internal/Admin/Notes
File: OnlineClothingStore.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WooCommerce Admin: Start your online clothing store.
[2] Fix | Delete
*
[3] Fix | Delete
* Adds a note to ask the client if they are considering starting an online
[4] Fix | Delete
* clothing store.
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
namespace Automattic\WooCommerce\Internal\Admin\Notes;
[8] Fix | Delete
[9] Fix | Delete
defined( 'ABSPATH' ) || exit;
[10] Fix | Delete
[11] Fix | Delete
use Automattic\WooCommerce\Admin\Notes\Note;
[12] Fix | Delete
use Automattic\WooCommerce\Admin\Notes\NoteTraits;
[13] Fix | Delete
[14] Fix | Delete
/**
[15] Fix | Delete
* Online_Clothing_Store.
[16] Fix | Delete
*/
[17] Fix | Delete
class OnlineClothingStore {
[18] Fix | Delete
/**
[19] Fix | Delete
* Note traits.
[20] Fix | Delete
*/
[21] Fix | Delete
use NoteTraits;
[22] Fix | Delete
[23] Fix | Delete
/**
[24] Fix | Delete
* Name of the note for use in the database.
[25] Fix | Delete
*/
[26] Fix | Delete
const NOTE_NAME = 'wc-admin-online-clothing-store';
[27] Fix | Delete
[28] Fix | Delete
/**
[29] Fix | Delete
* Returns whether the industries includes fashion-apparel-accessories.
[30] Fix | Delete
*
[31] Fix | Delete
* @param array $industries The industries to search.
[32] Fix | Delete
*
[33] Fix | Delete
* @return bool Whether the industries includes fashion-apparel-accessories.
[34] Fix | Delete
*/
[35] Fix | Delete
private static function is_in_fashion_industry( $industries ) {
[36] Fix | Delete
foreach ( $industries as $industry ) {
[37] Fix | Delete
if ( 'fashion-apparel-accessories' === $industry['slug'] ) {
[38] Fix | Delete
return true;
[39] Fix | Delete
}
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
return false;
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
/**
[46] Fix | Delete
* Get the note.
[47] Fix | Delete
*
[48] Fix | Delete
* @return Note
[49] Fix | Delete
*/
[50] Fix | Delete
public static function get_note() {
[51] Fix | Delete
// We want to show the note after two days.
[52] Fix | Delete
if ( ! self::is_wc_admin_active_in_date_range( 'week-1', 2 * DAY_IN_SECONDS ) ) {
[53] Fix | Delete
return;
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
$onboarding_profile = get_option( 'woocommerce_onboarding_profile', array() );
[57] Fix | Delete
[58] Fix | Delete
// Confirm that $onboarding_profile is set.
[59] Fix | Delete
if ( empty( $onboarding_profile ) ) {
[60] Fix | Delete
return;
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
// Make sure that the person who filled out the OBW was not setting up
[64] Fix | Delete
// the store for their customer/client.
[65] Fix | Delete
if (
[66] Fix | Delete
! isset( $onboarding_profile['setup_client'] ) ||
[67] Fix | Delete
$onboarding_profile['setup_client']
[68] Fix | Delete
) {
[69] Fix | Delete
return;
[70] Fix | Delete
}
[71] Fix | Delete
[72] Fix | Delete
// We need to show the notification when the industry is
[73] Fix | Delete
// fashion/apparel/accessories.
[74] Fix | Delete
if ( ! isset( $onboarding_profile['industry'] ) ) {
[75] Fix | Delete
return;
[76] Fix | Delete
}
[77] Fix | Delete
if ( ! self::is_in_fashion_industry( $onboarding_profile['industry'] ) ) {
[78] Fix | Delete
return;
[79] Fix | Delete
}
[80] Fix | Delete
[81] Fix | Delete
$note = new Note();
[82] Fix | Delete
$note->set_title( __( 'Start your online clothing store', 'woocommerce' ) );
[83] Fix | Delete
$note->set_content( __( 'Starting a fashion website is exciting but it may seem overwhelming as well. In this article, we\'ll walk you through the setup process, teach you to create successful product listings, and show you how to market to your ideal audience.', 'woocommerce' ) );
[84] Fix | Delete
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
[85] Fix | Delete
$note->set_name( self::NOTE_NAME );
[86] Fix | Delete
$note->set_content_data( (object) array() );
[87] Fix | Delete
$note->set_source( 'woocommerce-admin' );
[88] Fix | Delete
$note->add_action(
[89] Fix | Delete
'online-clothing-store',
[90] Fix | Delete
__( 'Learn more', 'woocommerce' ),
[91] Fix | Delete
'https://woocommerce.com/posts/starting-an-online-clothing-store/?utm_source=inbox&utm_medium=product',
[92] Fix | Delete
Note::E_WC_ADMIN_NOTE_ACTIONED
[93] Fix | Delete
);
[94] Fix | Delete
return $note;
[95] Fix | Delete
}
[96] Fix | Delete
}
[97] Fix | Delete
[98] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function