woocommerce/plugins/woocommerce-admin/client/marketing/utils/getRecommendationSource.ts

18 lines
463 B
TypeScript
Raw Normal View History

/**
* Internal dependencies
*/
import { getAdminSetting } from '~/utils/admin-settings';
/**
* Get the source of the marketing recommendations.
*
* When the marketplace suggestions feature is turned on, the source is 'woocommerce.com'. Otherwise, it is 'plugin-woocommerce'.
*/
export const getRecommendationSource = () => {
if ( getAdminSetting( 'allowMarketplaceSuggestions', false ) ) {
return 'woocommerce.com';
}
return 'plugin-woocommerce';
};