WordPress at Your Fingertips
function is not described

WC_Order::has_downloadable_item() public WC 1.0

Returns true if the order contains a downloadable product.

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

No Hooks.

Return

true|false.

Usage

$WC_Order = new WC_Order();
$WC_Order->has_downloadable_item();

Code of WC_Order::has_downloadable_item() WC 5.6.0

public function has_downloadable_item() {
	foreach ( $this->get_items() as $item ) {
		if ( $item->is_type( 'line_item' ) ) {
			$product = $item->get_product();

			if ( $product && $product->has_file() ) {
				return true;
			}
		}
	}
	return false;
}