Remove the first downloadable product note (#35318)
* Remove first downloadable product note * Add changelog entry * Remove obsolete note
This commit is contained in:
parent
ad1c49f9e4
commit
c62f9843b9
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: update
|
||||
|
||||
Remove first downloadable product note
|
|
@ -825,6 +825,7 @@ class WC_Install {
|
|||
'wc-admin-insight-first-product-and-payment',
|
||||
'wc-admin-store-notice-setting-moved',
|
||||
'wc-admin-store-notice-giving-feedback',
|
||||
'wc-admin-first-downloadable-product',
|
||||
'wc-admin-learn-more-about-product-settings',
|
||||
'wc-admin-adding-and-managing-products',
|
||||
'wc-admin-onboarding-profiler-reminder',
|
||||
|
|
|
@ -17,7 +17,6 @@ use \Automattic\WooCommerce\Internal\Admin\Notes\CustomizeStoreWithBlocks;
|
|||
use \Automattic\WooCommerce\Internal\Admin\Notes\CustomizingProductCatalog;
|
||||
use \Automattic\WooCommerce\Internal\Admin\Notes\EditProductsOnTheMove;
|
||||
use \Automattic\WooCommerce\Internal\Admin\Notes\EUVATNumber;
|
||||
use \Automattic\WooCommerce\Internal\Admin\Notes\FirstDownloadableProduct;
|
||||
use \Automattic\WooCommerce\Internal\Admin\Notes\FirstProduct;
|
||||
use \Automattic\WooCommerce\Internal\Admin\Notes\InstallJPAndWCSPlugins;
|
||||
use \Automattic\WooCommerce\Internal\Admin\Notes\LaunchChecklist;
|
||||
|
@ -76,7 +75,6 @@ class Events {
|
|||
CustomizingProductCatalog::class,
|
||||
EditProductsOnTheMove::class,
|
||||
EUVATNumber::class,
|
||||
FirstDownloadableProduct::class,
|
||||
FirstProduct::class,
|
||||
LaunchChecklist::class,
|
||||
MagentoMigration::class,
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* WooCommerce Admin Digital/Downloadable Producdt Handling note provider
|
||||
*
|
||||
* Adds a note with a link to the downloadable product handling
|
||||
*/
|
||||
|
||||
namespace Automattic\WooCommerce\Internal\Admin\Notes;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
use \Automattic\WooCommerce\Admin\Notes\Note;
|
||||
use \Automattic\WooCommerce\Admin\Notes\NoteTraits;
|
||||
|
||||
/**
|
||||
* FirstDownloadableProduct.
|
||||
*/
|
||||
class FirstDownloadableProduct {
|
||||
/**
|
||||
* Note traits.
|
||||
*/
|
||||
use NoteTraits;
|
||||
|
||||
/**
|
||||
* Name of the note for use in the database.
|
||||
*/
|
||||
const NOTE_NAME = 'wc-admin-first-downloadable-product';
|
||||
|
||||
/**
|
||||
* Get the note.
|
||||
*
|
||||
* @return Note
|
||||
*/
|
||||
public static function get_note() {
|
||||
$query = new \WC_Product_Query(
|
||||
array(
|
||||
'limit' => 1,
|
||||
'paginate' => true,
|
||||
'return' => 'ids',
|
||||
'downloadable' => 1,
|
||||
'status' => array( 'publish' ),
|
||||
)
|
||||
);
|
||||
$products = $query->get_products();
|
||||
|
||||
// There must be at least 1 downloadable product.
|
||||
if ( 0 === $products->total ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$note = new Note();
|
||||
$note->set_title( __( 'Learn more about digital/downloadable products', 'woocommerce' ) );
|
||||
$note->set_content(
|
||||
__(
|
||||
'Congrats on adding your first digital product! You can learn more about how to handle digital or downloadable products in our documentation.',
|
||||
'woocommerce'
|
||||
)
|
||||
);
|
||||
$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(
|
||||
'first-downloadable-product-handling',
|
||||
__( 'Learn more', 'woocommerce' ),
|
||||
'https://woocommerce.com/document/digital-downloadable-product-handling/?utm_source=inbox&utm_medium=product'
|
||||
);
|
||||
|
||||
return $note;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue