With the Astra theme header builder, you can add a cart to your menus, which by default will show inside the cart icon the number of products added to the cart, and so far so good…

But it turns out that the cart always displays the number of items, even if it is empty, showing a zero (0).
If you want that when the cart is empty Astra does not show that zero, that it shows the cart really empty, you can easily achieve this by adding this filter:
/* Remove number when cart is empty */
add_filter('astra_woo_header_cart_total', 'remove_cart_count');
function remove_cart_count( $default){
if(0 == WC()->cart->get_cart_contents_count()){
return false;
}else{
return $default;
}
}
Code language: PHP (php)
Now the cart, when there are no products added, will be shown really empty, without any numbers, showing only numbers when there are products in the cart.

Where do I add this code?
In this case, the ideal way is to add the code at the end of the functions.php
file of your Astra child theme, as I explain in this tutorial: