Automattic\WooCommerce\Admin\Features\Fulfillments

Fulfillment::get_item_countpublicWC 10.7.0

Get the item count for the fulfillment.

This method calculates the total quantity of items in the fulfillment.

Метод класса: Fulfillment{}

Хуков нет.

Возвращает

int. Total quantity of items in the fulfillment.

Использование

$Fulfillment = new Fulfillment();
$Fulfillment->get_item_count(): int;

Список изменений

С версии 10.7.0 Введена.

Код Fulfillment::get_item_count() WC 11.0.1

public function get_item_count(): int {
	return array_reduce(
		$this->get_items(),
		function ( int $carry, array $item ) {
			return $carry + (int) $item['qty'];
		},
		0
	);
}