Try this; it's from the WC function that displays a link to the cart when there are items in the cart. The differences are the use of global
and the > 0
operand:
global $woocommerce;
if ( sizeof( $woocommerce->cart->cart_contents) > 0 ) :
echo '<p>hello there</p>';
endif;