WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports\Orders\Stats

DataStore::get_num_items_sold() protected WC 1.0

Get number of items sold among all orders.

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

No Hooks.

Return

Int. Nothing.

Usage

$result = DataStore::get_num_items_sold( $order );
$order(array) (required)
WC_Order object.

Code of DataStore::get_num_items_sold() WC 5.2.2

<?php
protected static function get_num_items_sold( $order ) {
	$num_items = 0;

	$line_items = $order->get_items( 'line_item' );
	foreach ( $line_items as $line_item ) {
		$num_items += $line_item->get_quantity();
	}

	return $num_items;
}