WC_Abstract_Order::has_shipping_method( string $method_id )

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


Description Description


Parameters Parameters

$method_id

(Required) Method ID to check.


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: includes/abstracts/abstract-wc-order.php

	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;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.