Automattic\WooCommerce\Admin\Marketing

InstalledExtensions::get_google_extension_data()protected staticWC 1.0

Get Google extension data.

Method of the class: InstalledExtensions{}

No Hooks.

Return

Array|true|false.

Usage

$result = InstalledExtensions::get_google_extension_data();

InstalledExtensions::get_google_extension_data() code WC 7.1.0

protected static function get_google_extension_data() {
	$slug = 'google-listings-and-ads';

	if ( ! PluginsHelper::is_plugin_installed( $slug ) ) {
		return false;
	}

	$data         = self::get_extension_base_data( $slug );
	$data['icon'] = WC_ADMIN_IMAGES_FOLDER_URL . '/marketing/google.svg';

	if ( 'activated' === $data['status'] && function_exists( 'woogle_get_container' ) && class_exists( '\Automattic\WooCommerce\GoogleListingsAndAds\MerchantCenter\MerchantCenterService' ) ) {

		$merchant_center = woogle_get_container()->get( \Automattic\WooCommerce\GoogleListingsAndAds\MerchantCenter\MerchantCenterService::class );

		if ( $merchant_center->is_setup_complete() ) {
			$data['status']      = 'configured';
			$data['settingsUrl'] = admin_url( 'admin.php?page=wc-admin&path=/google/settings' );
		} else {
			$data['settingsUrl'] = admin_url( 'admin.php?page=wc-admin&path=/google/start' );
		}

		$data['docsUrl'] = 'https://woocommerce.com/document/google-listings-and-ads/?utm_medium=product';
	}

	return $data;
}