Configuration:
WordPress 4.1 The Events Calendar PRO 3.9 The Events Calendar: WooCommerce Tickets 3.9 WooCommerce 2.2.11 WooCommerce Product Bundles 4.6.2 For an Events
You can use the same function in early posts that is written here
function so_28359520_cart_contents_count( $count ) {
$cart = WC()->cart->get_cart();
$subtract = 0;
foreach ( $cart as $key => $value ) {
if ( isset( $value[ 'stamp' ] ) && ! isset( $value[ 'bundled_by' ] ) ) {
$subtract += $value[ 'quantity' ];
}
}
return $count - $subtract;
}
But you must use it inside class-wc-pb-cart.php
and inside construct add
add_filter( 'woocommerce_cart_contents_count', 'so_28359520_cart_contents_count' );
That works like a charm , but in my theme I had problem with WC()->cart->cart_contents_count in header.php , somehow the filter is not applied on that , but using
cart->get_cart_contents_count();
?>
Inside header.php the filter is applied and I get the correct count.