I'm trying to add a custom text on the minicart icon on our site's header, when no product is on the cart.
I tried this and it works for a second, but something inmediately replaces the custom text for a “0”…
What could be happening here? I heard there's something called "fragments" that could be interfering but I'm not sure where to look for it.
<div class="header-cart-count">
<?php
if ( ! WC()->cart->is_empty() ) {
echo WC()->cart->get_cart_contents_count();
}else{
echo "SUPER COOL CUSTOM TEXT";
}
?>
</div>