Fixed the Add First Product email note checks (https://github.com/woocommerce/woocommerce-admin/pull/6260)

* Added extra filters to note

This commit adds extra filters to email note.

* Fixed note image and css

This commit fixes a few things related to the note image, css and some checks

* Fixed css and note image replaced

* Added readme.txt

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
This commit is contained in:
Fernando 2021-02-03 17:15:43 -03:00 committed by GitHub
parent 600c91a2cc
commit 3ffc2c32ec
5 changed files with 15 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -15,7 +15,7 @@ do_action( 'woocommerce_email_header', $email_heading, $email );
<?php if ( isset( $email_image ) ) { ?> <?php if ( isset( $email_image ) ) { ?>
<div> <div>
<img src="<?php echo esc_url( $email_image ); ?>" style="display: block; margin-bottom: 24px;"/> <img src="<?php echo esc_url( $email_image ); ?>" style="display: block; margin-bottom: 24px; width: 90px;"/>
</div> </div>
<?php } ?> <?php } ?>

View File

@ -84,6 +84,7 @@ Release and roadmap notes are available on the [WooCommerce Developers Blog](htt
- Dev: Add wait script for mysql to be ready for phpunit tests in docker. #6185 - Dev: Add wait script for mysql to be ready for phpunit tests in docker. #6185
- Update: Homescreen layout, moving Inbox panel for better interaction. #6122 - Update: Homescreen layout, moving Inbox panel for better interaction. #6122
- Dev: Remove old debug code for connecting to Calypso / Wordpress.com. #6097 - Dev: Remove old debug code for connecting to Calypso / Wordpress.com. #6097
- Fix: Fixed the Add First Product email note checks. #6260
== Changelog == == Changelog ==

View File

@ -29,8 +29,8 @@ class AddFirstProduct {
* @return Note * @return Note
*/ */
public static function get_note() { public static function get_note() {
// We want to show the note after three days. // We want to show the note after 3 days and before 30.
if ( ! self::wc_admin_active_for( 3 * DAY_IN_SECONDS ) ) { if ( ! self::wc_admin_active_for( 3 * DAY_IN_SECONDS ) || self::wc_admin_active_for( 30 * DAY_IN_SECONDS ) ) {
return; return;
} }
@ -47,6 +47,16 @@ class AddFirstProduct {
return; return;
} }
// Don't show if there is an orders.
$args = array(
'limit' => 1,
'return' => 'ids',
);
$orders = wc_get_orders( $args );
if ( 0 !== count( $orders ) ) {
return;
}
$content_lines = array( $content_lines = array(
__( 'Nice one, youve created a WooCommerce store! Now its time to add your first product.<br/><br/>', 'woocommerce-admin' ), __( 'Nice one, youve created a WooCommerce store! Now its time to add your first product.<br/><br/>', 'woocommerce-admin' ),
__( 'There are three ways to add your products: you can <strong>create products manually, import them at once via CSV file</strong>, or <strong>migrate them from another service</strong>.<br/><br/>', 'woocommerce-admin' ), __( 'There are three ways to add your products: you can <strong>create products manually, import them at once via CSV file</strong>, or <strong>migrate them from another service</strong>.<br/><br/>', 'woocommerce-admin' ),
@ -63,7 +73,7 @@ class AddFirstProduct {
$note->set_content_data( (object) $additional_data ); $note->set_content_data( (object) $additional_data );
$note->set_image( $note->set_image(
plugins_url( plugins_url(
'/images/admin_notes/img-product-light.png', '/images/admin_notes/openbox+purple.png',
WC_ADMIN_PLUGIN_FILE WC_ADMIN_PLUGIN_FILE
) )
); );