WC_Cart::get_cart_item()publicWC 1.0

Returns a specific item in the cart.

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.

WC_Cart::get_cart_item() code WC 8.7.0

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