I removed the cart count bubble long time ago in code, and now I cant find a way to bring it back. I would like to add the cart count number back to my site and show it inside the cart icon on mobile view. Can this be done by adding some code?
Here is a link to the site: https://568839.myshopify.com/
Hi @galleriste
You remove the count from the code to retrieve it you need to follow these steps:
- Open Theme
- select three dot → select code editor
- find the header.liquid file
- search this code
In the
Past that code
{{ cart.item_count }}
Then search for Base.css and past that css
.cart-link__bubble--visible {
top: 9px !important;
width: 15px !important;
height: 15px!important;
color: #fff;
font-size: 9px;
text-align: center;
}
I Hope This work
1 Like
Is it possible to hide the cart count if it is 0?
Yeah Sure you can do that by simply adding a If condition in that above code
Here is the modified code
{% if cart.item_count > 0 %}
<span class="cart-link__bubble cart-link__bubble--visible">{{ cart.item_count }}</span>
{% endif %}
If This Solution worked Like This and Mark it as a Solution
1 Like