WordPress at Your Fingertips
function is not described

WC_Abstract_Order::get_item_count() public WC 1.0

Gets the count of order items of a certain type.

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

Hooks from the method

Return

Int|String.

Usage

$WC_Abstract_Order = new WC_Abstract_Order();
$WC_Abstract_Order->get_item_count( $item_type );
$item_type(string)
Item type to lookup.
Default: ''

Code of WC_Abstract_Order::get_item_count() WC 5.8.0

public function get_item_count( $item_type = '' ) {
	$items = $this->get_items( empty( $item_type ) ? 'line_item' : $item_type );
	$count = 0;

	foreach ( $items as $item ) {
		$count += $item->get_quantity();
	}

	return apply_filters( 'woocommerce_get_item_count', $count, $item_type, $this );
}