WC_Admin_Notices::no_shipping_methods_notice()public staticWC 1.0

No shipping methods.

Method of the class: WC_Admin_Notices{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = WC_Admin_Notices::no_shipping_methods_notice();

WC_Admin_Notices::no_shipping_methods_notice() code WC 8.9.0

public static function no_shipping_methods_notice() {
        // phpcs:ignore WordPress.Security.NonceVerification.Recommended
	if ( wc_shipping_enabled() && ( empty( $_GET['page'] ) || empty( $_GET['tab'] ) || 'wc-settings' !== $_GET['page'] || 'shipping' !== $_GET['tab'] ) ) {
		$product_count = wp_count_posts( 'product' );
		$method_count  = wc_get_shipping_method_count();

		if ( $product_count->publish > 0 && 0 === $method_count ) {
			include __DIR__ . '/views/html-notice-no-shipping-methods.php';
		}

		if ( $method_count > 0 ) {
			self::remove_notice( 'no_shipping_methods' );
		}
	}
}