WC_Order::has_downloadable_item()

Returns true if the order contains a downloadable product.


Description Description


Return Return

(bool)


Top ↑

Source Source

File: includes/class-wc-order.php

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

Top ↑

User Contributed Notes User Contributed Notes

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