WC_Cart::get_cart_item()publicWC 1.0

Returns a specific item in the cart.

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

No Hooks.

Return

Array. Item data

Usage

$WC_Cart = new WC_Cart();
$WC_Cart->get_cart_item( $item_key );
$item_key(string) (required)
Cart item key.

Code of WC_Cart::get_cart_item() WC 6.7.0

public function get_cart_item( $item_key ) {
	return isset( $this->cart_contents[ $item_key ] ) ? $this->cart_contents[ $item_key ] : array();
}