Remove the first downloadable product note (#35318)

* Remove first downloadable product note

* Add changelog entry

* Remove obsolete note
This commit is contained in:
Joshua T Flowers 2022-11-03 13:13:01 -07:00 committed by GitHub
parent ad1c49f9e4
commit c62f9843b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 73 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: update
Remove first downloadable product note

View File

@ -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',

View File

@ -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,

View File

@ -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;
}
}