How to add item count number to cart icon in Brooklyn theme

Solved
lovechidozie
Excursionist
17 5 3

I'm having trouble figuring out how to add the an item count number to my store's cart icon on Brooklyn theme. Please assist me in solving this problem.

Replies 20 (20)
Pawan2794
Tourist
9 0 1

Hello , it worked perfectly for the desktop view, but it still is the same for mobile view. nothing gets added to cart under mobile view. Please Help

Jeeg
Tourist
8 1 4

In header.liquid find this code

 

<div class="site-nav--mobile text-right">

 

Then below you should find a line starting with

 

<span class="cart-link__bubble

 

 Replace it with

 

<span class="cart-link__bubble{% if cart.item_count > 0 %} cart-link__bubble--visible{% endif %}">{{ cart.item_count }}</span>

 

Pawan2794
Tourist
9 0 1

Thank you so much, worked perfectly

Patte
New Member
1 0 1

Hey all,

I any ideas on how to get the card item count dynamically updated if a new item is added or removed from the card?

Is there some kind of a hook/event available in Shopify to get a response of a newly added/removed item? Or do I have to listen to every single click on the "add to card" button to get the card count updated?

Best

Patrick 

Florency
Shopify Partner
16 0 3

cart count icon not showing number of items . Is there any way without referesh it shows the number of items in cart count ? 

 

Please help me im new to the development. 

Thanks.

RawMenswear
New Member
3 0 0

Hi, This worked perfectly on a mobile but im not getting the count on a desktop. Please Help.

Jeeg
Tourist
8 1 4

In the previous page you find the solution for the desktop.

RawMenswear
New Member
3 0 0

Hi Jeeg

Do i add both sets of coding? one for mobile and one for mobile? 

Thanks 

Jeeg
Tourist
8 1 4
Yes, both of them will make the trick.
RawMenswear
New Member
3 0 0

sorry to be a pain, this hasnt solved the problem.

I'm finding that i'm getting the counter on mobile but not on a desktop. I still get a bubble and nt a counter number. also the cart doesn't automatically update when i add an item. You have to refresh the page for the counter to update itself. New to all this so apologies in advance. Take alook if possible? https://rawmenswear.co.uk/

Thanks