Automattic\WooCommerce\Admin\Features\Fulfillments
Fulfillment::get_item_count
Get the item count for the fulfillment.
This method calculates the total quantity of items in the fulfillment.
Method of the class: Fulfillment{}
No Hooks.
Returns
int. Total quantity of items in the fulfillment.
Usage
$Fulfillment = new Fulfillment(); $Fulfillment->get_item_count(): int;
Changelog
| Since 10.7.0 | Introduced. |
Fulfillment::get_item_count() Fulfillment::get item count code 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
);
}