Automattic\WooCommerce\StoreApi\Utilities

CartController::get_cart_items()publicWC 1.0

Returns all cart items.

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

CartController::get_cart_items() code WC 8.7.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() );
}