woocommerce_order_needs_shipping filter-hookWC 9.9.0

Filter to modify the needs shipping value for a given order.

Usage

add_filter( 'woocommerce_order_needs_shipping', 'wp_kama_woocommerce_order_needs_shipping_filter', 10, 2 );

/**
 * Function for `woocommerce_order_needs_shipping` filter-hook.
 * 
 * @param bool              $needs_shipping The value originally calculated.
 * @param WC_Abstract_Order $order          The order for which the value is calculated.
 *
 * @return bool
 */
function wp_kama_woocommerce_order_needs_shipping_filter( $needs_shipping, $order ){

	// filter...
	return $needs_shipping;
}
$needs_shipping(true|false)
The value originally calculated.
$order(WC_Abstract_Order)
The order for which the value is calculated.

Changelog

Since 9.9.0 Introduced.

Where the hook is called

WC_Abstract_Order::needs_shipping()
woocommerce_order_needs_shipping
woocommerce/includes/abstracts/abstract-wc-order.php 2533
return apply_filters( 'woocommerce_order_needs_shipping', $needs_shipping, $this );

Where the hook is used in WooCommerce

Usage not found.