Astra’s Header Footer Builder comes with the WooCommerce Cart element that allows you to add the mini-cart to your header. By default, the mini-cart displays a number of items added to the cart together with the icon.
The mini-cart will show the number “0” until the first product is added to the cart.
In case you would like to hide this number, you can do it by adding a custom code (filter). Adding the filter will hide the number of products while the mini-cart is empty.
To do this, you would need to add the following filter to the functions.php file of your Child Theme:
add_action('wp_footer', 'hide_cart'); function hide_cart() { if(WC()->cart->get_cart_contents_count() == 0) echo '<style type="text/css">.ast-site-header-cart .ast-addon-cart-wrap i.astra-icon:after{display:none}</style>'; } add_filter( 'woocommerce_product_categories_widget_args', 'woo_product_cat_widget_args' );
If you don’t have your Child Theme installed, please check this article on how to do it.
If you are not sure how to add this code, please check this article.