WC_Cart::get_cart_item()
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() WC Cart::get cart item code WC 9.6.1
public function get_cart_item( $item_key ) { return isset( $this->cart_contents[ $item_key ] ) ? $this->cart_contents[ $item_key ] : array(); }