Add Number Count to Cart Icon Impulse Theme

Hi,

im looking to add number count to my bag icon. My site is https://luxurymrkt.com

Hello plz add below sol,

Step 1 : add below css in them.css file.

.cart-link__bubble–visible {
top: 15px !important;
right: 15px !important;
width: 24px !important;
height: 25px !important;
color: white !important;
display: grid !important;
align-items: center !important;
justify-content: center !important;
padding-left: 2px !important;
}

Step 2 : add below js code in theme.js file

$(‘.add-to-cart’).click(function(){
setTimeout(function(){
$.getJSON(‘/cart.js’, function(cart){
var result = cart.item_count;
$(‘.cart-link__bubble’).text(result);
console.log(result);
});
},1000);
});

I got it to work. But it only works for whatever current page you’re on. If you add to cart then leave that page go back to home or another page it doesn’t display anything

see preview https://usexumtwexgce70c-53548449973.shopifypreview.com

is there a way to fix this?