Make sure product count and revenue items are set in choose niche note (https://github.com/woocommerce/woocommerce-admin/pull/4764)

Co-authored-by: Rebecca Scott <me@becdetat.com>
This commit is contained in:
Bec Scott 2020-07-09 14:49:40 +10:00 committed by GitHub
parent a6a8b82280
commit 0faca8a0d7
1 changed files with 10 additions and 0 deletions

View File

@ -44,6 +44,16 @@ class WC_Admin_Notes_Choose_Niche {
return; return;
} }
// Make sure that the product count is set in the onboarding profile.
if ( ! isset( $onboarding_profile['product_count'] ) ) {
return;
}
// Make sure that the revenue is set in the onboarding profile.
if ( ! isset( $onboarding_profile['revenue'] ) ) {
return;
}
// We need to show the notification when product number is 0 or the revenue is 'none' or 'up to 2500'. // We need to show the notification when product number is 0 or the revenue is 'none' or 'up to 2500'.
if ( if (
0 !== (int) $onboarding_profile['product_count'] && 0 !== (int) $onboarding_profile['product_count'] &&