WC_Admin_Notices::legacy_shipping_notice()public staticWC 1.0

Show a notice asking users to convert to shipping zones.

Метод класса: WC_Admin_Notices{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = WC_Admin_Notices::legacy_shipping_notice();

Код WC_Admin_Notices::legacy_shipping_notice() WC 9.4.2

public static function legacy_shipping_notice() {
	$maybe_load_legacy_methods = array( 'flat_rate', 'free_shipping', 'international_delivery', 'local_delivery', 'local_pickup' );
	$enabled                   = false;

	foreach ( $maybe_load_legacy_methods as $method ) {
		$options = get_option( 'woocommerce_' . $method . '_settings' );
		if ( $options && isset( $options['enabled'] ) && 'yes' === $options['enabled'] ) {
			$enabled = true;
		}
	}

	if ( $enabled ) {
		include __DIR__ . '/views/html-notice-legacy-shipping.php';
	} else {
		self::remove_notice( 'template_files' );
	}
}