WC_Cart::filter_items_needing_shipping()protectedWC 3.0.0

Filter items needing shipping callback.

Method of the class: WC_Cart{}

No Hooks.

Return

true|false.

Usage

// protected - for code of main (parent) or child class
$result = $this->filter_items_needing_shipping( $item );
$item(array) (required)
Item to check for shipping.

Changelog

Since 3.0.0 Introduced.

WC_Cart::filter_items_needing_shipping() code WC 8.7.0

protected function filter_items_needing_shipping( $item ) {
	$product = $item['data'];
	return $product && $product->needs_shipping();
}