WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\Features

ShippingLabelBanner::count_shippable_items() private WC 1.0

Count shippable items

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

No Hooks.

Return

Int. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->count_shippable_items( \WC_Order $order );
\WC_Order $order (required)
-

Code of ShippingLabelBanner::count_shippable_items() WC 5.3.0

<?php
private function count_shippable_items( \WC_Order $order ) {
	$count = 0;
	foreach ( $order->get_items() as $item ) {
		if ( $item instanceof \WC_Order_Item_Product ) {
			$product = $item->get_product();
			if ( $product && $product->needs_shipping() ) {
				$count += $item->get_quantity();
			}
		}
	}
	return $count;
}