WordPress at Your Fingertips
function is not described

WC_Abstract_Order::has_shipping_method() public WC 1.0

Check whether this order has a specific shipping method or not.

{} It's a method of the class: WC_Abstract_Order{}

No Hooks.

Return

true|false.

Usage

$WC_Abstract_Order = new WC_Abstract_Order();
$WC_Abstract_Order->has_shipping_method( $method_id );
$method_id(string) (required)
Method ID to check.

Code of WC_Abstract_Order::has_shipping_method() WC 5.8.0

public function has_shipping_method( $method_id ) {
	foreach ( $this->get_shipping_methods() as $shipping_method ) {
		if ( strpos( $shipping_method->get_method_id(), $method_id ) === 0 ) {
			return true;
		}
	}
	return false;
}