Hide Marketing Tab Recomended Extensions card if marketing suggestions are disabled (https://github.com/woocommerce/woocommerce-admin/pull/4194)
* Add allowMarketplaceSuggestions to woocommerce_shared_settings * Convert to functional component * Hide ReccomendedExtensions card if opted out from marketing suggestions
This commit is contained in:
parent
68247a28b8
commit
16fdae3d06
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* External dependencies
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { Component } from '@wordpress/element';
|
||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
|
@ -13,17 +13,17 @@ import KnowledgeBase from './knowledge-base';
|
|||
import WelcomeCard from './welcome-card';
|
||||
import '../data';
|
||||
|
||||
class MarketingOverview extends Component {
|
||||
render() {
|
||||
return (
|
||||
<div className="woocommerce-marketing-overview">
|
||||
<WelcomeCard />
|
||||
<InstalledExtensions />
|
||||
<RecommendedExtensions />
|
||||
<KnowledgeBase />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
const MarketingOverview = () => {
|
||||
const allowMarketplaceSuggestions = getSetting( 'allowMarketplaceSuggestions', false );
|
||||
|
||||
return (
|
||||
<div className="woocommerce-marketing-overview">
|
||||
<WelcomeCard />
|
||||
<InstalledExtensions />
|
||||
{ allowMarketplaceSuggestions && <RecommendedExtensions /> }
|
||||
<KnowledgeBase />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default MarketingOverview;
|
||||
|
|
|
@ -12,6 +12,7 @@ use \_WP_Dependency;
|
|||
use Automattic\WooCommerce\Admin\Features\Onboarding;
|
||||
use Automattic\WooCommerce\Admin\API\Reports\Orders\DataStore as OrdersDataStore;
|
||||
use Automattic\WooCommerce\Admin\API\Plugins;
|
||||
use WC_Marketplace_Suggestions;
|
||||
|
||||
/**
|
||||
* Loader Class.
|
||||
|
@ -755,6 +756,9 @@ class Loader {
|
|||
if ( self::is_embed_page() ) {
|
||||
$settings['embedBreadcrumbs'] = self::get_embed_breadcrumbs();
|
||||
}
|
||||
|
||||
$settings['allowMarketplaceSuggestions'] = WC_Marketplace_Suggestions::allow_suggestions();
|
||||
|
||||
return $settings;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue