WC_Cart::get_cart_contents_count PHP Method

get_cart_contents_count() public method

Get number of items in the cart.
    public function get_cart_contents_count()
    {
        return apply_filters('woocommerce_cart_contents_count', array_sum(wp_list_pluck($this->get_cart(), 'quantity')));
    }
WC_Cart