WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Utilities

CartController::get_cart_items() public WC 1.0

Returns all cart items.

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

No Hooks.

Return

Array.

Usage

$CartController = new CartController();
$CartController->get_cart_items( $callback );
$callback(callable)
Optional callback to apply to the array filter.
Default: null

Code of CartController::get_cart_items() WC 5.8.0

public function get_cart_items( $callback = null ) {
	$cart = $this->get_cart_instance();
	return $callback ? array_filter( $cart->get_cart(), $callback ) : array_filter( $cart->get_cart() );
}