WC_Admin_Notices::legacy_shipping_notice()
Show a notice asking users to convert to shipping zones.
Method of the class: WC_Admin_Notices{}
No Hooks.
Return
null
. Nothing (null).
Usage
$result = WC_Admin_Notices::legacy_shipping_notice();
WC_Admin_Notices::legacy_shipping_notice() WC Admin Notices::legacy shipping notice code WC 9.8.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' ); } }