From 37ea3faf0a84ab6392cffcca58b0858b6f3e6567 Mon Sep 17 00:00:00 2001 From: Nicola Mustone Date: Tue, 18 Nov 2014 20:48:45 +0100 Subject: [PATCH] Added missing get_cart_item --- includes/class-wc-cart.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/includes/class-wc-cart.php b/includes/class-wc-cart.php index 2e8aedbb532..36b70c5fc5a 100644 --- a/includes/class-wc-cart.php +++ b/includes/class-wc-cart.php @@ -708,6 +708,19 @@ class WC_Cart { return $cart_session; } + /** + * Returns a specific itme in the cart + * + * @return array item data + */ + public function get_cart_item( $item_key ) { + if ( isset( $this->cart_contents[ $item_key ] ) ) { + return $this->cart_contents[ $item_key ]; + } + + return false; + } + /** * Returns the cart and shipping taxes, merged. *