Remove product settings video note (https://github.com/woocommerce/woocommerce-admin/pull/5213)
Co-authored-by: Rebecca Scott <me@becdetat.com>
This commit is contained in:
parent
305eff84b3
commit
2ba064abf4
|
@ -30,7 +30,6 @@ use \Automattic\WooCommerce\Admin\Loader;
|
|||
use \Automattic\WooCommerce\Admin\Notes\Insight_First_Sale;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Home_Screen_Feedback;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Need_Some_Inspiration;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Learn_More_About_Product_Settings;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Online_Clothing_Store;
|
||||
use \Automattic\WooCommerce\Admin\Notes\First_Product;
|
||||
use \Automattic\WooCommerce\Admin\Notes\Customize_Store_With_Blocks;
|
||||
|
@ -99,7 +98,6 @@ class Events {
|
|||
Launch_Checklist::possibly_add_note();
|
||||
Home_Screen_Feedback::possibly_add_note();
|
||||
Need_Some_Inspiration::possibly_add_note();
|
||||
Learn_More_About_Product_Settings::possibly_add_note();
|
||||
Online_Clothing_Store::possibly_add_note();
|
||||
First_Product::possibly_add_note();
|
||||
Choose_Niche::possibly_add_note();
|
||||
|
|
|
@ -471,6 +471,7 @@ class Install {
|
|||
'wc-admin-welcome-note',
|
||||
'wc-admin-store-notice-setting-moved',
|
||||
'wc-admin-store-notice-giving-feedback',
|
||||
'wc-admin-learn-more-about-product-settings',
|
||||
);
|
||||
|
||||
$additional_obsolete_notes_names = apply_filters(
|
||||
|
|
|
@ -335,25 +335,6 @@ class WC_Admin_Notes_Launch_Checklist extends DeprecatedClassFacade {
|
|||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Learn_More_About_Product_Settings (deprecated, use Learn_More_About_Product_Settings instead).
|
||||
*/
|
||||
class WC_Admin_Notes_Learn_More_About_Product_Settings extends DeprecatedClassFacade {
|
||||
/**
|
||||
* The name of the non-deprecated class that this facade covers.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $facade_over_classname = 'Automattic\WooCommerce\Admin\Notes\Learn_More_About_Product_Settings';
|
||||
|
||||
/**
|
||||
* The version that this class was deprecated in.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $deprecated_in_version = '1.6.0';
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Admin_Notes_Marketing (deprecated, use Marketing instead).
|
||||
*/
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* WooCommerce Admin: Learn more about Product Settings
|
||||
*
|
||||
* Adds a note about learning more about product settings.
|
||||
*/
|
||||
|
||||
namespace Automattic\WooCommerce\Admin\Notes;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use \Automattic\WooCommerce\Admin\Features\Onboarding;
|
||||
|
||||
/**
|
||||
* Learn_More_About_Product_Settings.
|
||||
*/
|
||||
class Learn_More_About_Product_Settings {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
use NoteTraits;
|
||||
|
||||
/**
|
||||
* Name of the note for use in the database.
|
||||
*/
|
||||
const NOTE_NAME = 'wc-admin-learn-more-about-product-settings';
|
||||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
$onboarding_profile = get_option( 'woocommerce_onboarding_profile', array() );
|
||||
|
||||
// Confirm that $onboarding_profile is set.
|
||||
if ( empty( $onboarding_profile ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Make sure that the person who filled out the OBW was not setting up
|
||||
// the store for their customer/client.
|
||||
if (
|
||||
isset( $onboarding_profile['setup_client'] )
|
||||
&& $onboarding_profile['setup_client']
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Make sure that products were added at least one day ago.
|
||||
$query = new \WC_Product_Query(
|
||||
array(
|
||||
'limit' => 1,
|
||||
'status' => 'publish',
|
||||
'orderby' => 'date',
|
||||
'order' => 'ASC',
|
||||
)
|
||||
);
|
||||
$products = $query->get_products();
|
||||
if ( 0 === count( $products ) ) {
|
||||
return;
|
||||
}
|
||||
$oldest_product_timestamp = $products[0]->get_date_created()->getTimestamp();
|
||||
if ( ( time() - $oldest_product_timestamp ) < DAY_IN_SECONDS ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Learn more about Product Settings', 'woocommerce-admin' ) );
|
||||
$note->set_content( __( 'In this video you\'ll find information about configuring product settings, such as how they are displayed, editing inventory options and so on.', 'woocommerce-admin' ) );
|
||||
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
|
||||
$note->set_name( self::NOTE_NAME );
|
||||
$note->set_content_data( (object) array() );
|
||||
$note->set_source( 'woocommerce-admin' );
|
||||
$note->add_action(
|
||||
'learn-more-about-product-settings',
|
||||
__( 'Watch tutorial', 'woocommerce-admin' ),
|
||||
'https://www.youtube.com/watch?v=FEmwJsE8xDY&t=',
|
||||
Note::E_WC_ADMIN_NOTE_ACTIONED,
|
||||
true
|
||||
);
|
||||
return $note;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue