woocommerce_cart_contents_count filter-hookWC 1.0

Get number of items in the cart.

Usage

add_filter( 'woocommerce_cart_contents_count', 'wp_kama_woocommerce_cart_contents_count_filter' );

/**
 * Function for `woocommerce_cart_contents_count` filter-hook.
 * 
 * @param  $array_sum 
 *
 * @return 
 */
function wp_kama_woocommerce_cart_contents_count_filter( $array_sum ){

	// filter...
	return $array_sum;
}
$array_sum
-

Where the hook is called

WC_Cart::get_cart_contents_count()
woocommerce_cart_contents_count
woocommerce/includes/class-wc-cart.php 661
return apply_filters( 'woocommerce_cart_contents_count', array_sum( wp_list_pluck( $this->get_cart(), 'quantity' ) ) );

Where the hook is used in WooCommerce

Usage not found.