Docs

Hide the Cart Count When the Item Count is Zero

Updated on

In this documentation, we will show how to hide the cart count when the cart is empty using a simple CSS snippet.

By default, FunnelKit Cart displays a cart count of zero when no items are added to the cart, as shown below. 

preview zero count

Steps To Follow To Hide The Cart Count When The Cart Item Is Zero 

  1. Navigate to FunnelKit ⇒ Cart and move to the Styling tab.
FunnelKit Styling option in the FunnelKit Cart settings menu
  1. Next, scroll to the Custom CSS section and add the following code. 
div#fkit-floating-count[data-item-count="0"], #fkcart-mini-toggler .fkcart-shortcode-count.fkcart-item-count[data-item-count="0"] { display: none; }
Custom CSS code added to FunnelKit Cart styling
  1. Make sure to hit Save to update

Now, if you check the front end, the cart count will be hidden when there are no items in the cart.

Hide the Cart Count When the Item Count is Zero

But if you add any product to your cart, then the cart count will show up. 

FunnelKit Cart icon with the item count badge