How To Check Whether An WooCommerce Order Has A Specific Shipping Method Programmatically

How can I check the WooCommerce order has been shipped by a specific shipping method programmatically

You can use WooCommerce method has_shipping_method to check whether an WooCommerce order has a specific shipping method.

$order = wc_get_order($order_id);
if( $order->has_shipping_method('flat_rate') ) { 

}
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments