diff --git a/includes/admin/marketplace-suggestions/class-wc-marketplace-suggestions.php b/includes/admin/marketplace-suggestions/class-wc-marketplace-suggestions.php index 71cfba394fe..00945857834 100644 --- a/includes/admin/marketplace-suggestions/class-wc-marketplace-suggestions.php +++ b/includes/admin/marketplace-suggestions/class-wc-marketplace-suggestions.php @@ -178,6 +178,11 @@ class WC_Marketplace_Suggestions { return false; } + // Suggestions may be disabled via a setting under Accounts & Privacy. + if ( 'no' === get_option( 'woocommerce_show_marketplace_suggestions', 'yes' ) ) { + return false; + } + // User can disabled all suggestions via filter. return apply_filters( 'woocommerce_allow_marketplace_suggestions', true ); } diff --git a/includes/admin/settings/class-wc-settings-accounts.php b/includes/admin/settings/class-wc-settings-accounts.php index ff68310a650..6b2f481350b 100644 --- a/includes/admin/settings/class-wc-settings-accounts.php +++ b/includes/admin/settings/class-wc-settings-accounts.php @@ -255,6 +255,26 @@ class WC_Settings_Accounts extends WC_Settings_Page { 'type' => 'sectionend', 'id' => 'tracking_options', ), + array( + 'title' => esc_html__( 'Marketplace suggestions', 'woocommerce' ), + 'type' => 'title', + 'id' => 'marketplace_suggestions', + 'desc' => __( 'We show contextual suggestions for official extensions that may be helpful to your store.', 'woocommerce' ), + ), + array( + 'title' => __( 'Show Suggestions', 'woocommerce' ), + 'desc' => __( 'Display suggestions within WooCommerce', 'woocommerce' ), + 'desc_tip' => esc_html__( 'Leave this box unchecked if you do not want to see suggested extensions.', 'woocommerce' ), + 'id' => 'woocommerce_show_marketplace_suggestions', + 'type' => 'checkbox', + 'checkboxgroup' => 'start', + 'default' => 'yes', + 'autoload' => false, + ), + array( + 'type' => 'sectionend', + 'id' => 'marketplace_suggestions', + ), ) );