Items in sticky not immediately updating to show added to cart

When I add and item to the cart. (Mobile) it doesnt immediately show in the updated sticky cart bar. Please help. www.shopcuzzo.com

@Mrstep well you need to add code for updating the cart to the sticky bar as well like header.

Can you help?

Off course it will need some custom code which can be done my me.

Thanks soooo much!!! let me know what I need to do

Ok let me code and share it with you shorty.

1 Like

No Problem

still working on it?

Still coding?

Just sharing today no worries

1 Like

Thx again

@Mrstep you can add below code into your main.js file at the end which is located in the theme > assets files and hopefully it will work.

$(document).ready(function() {

  // Function to update the cart count
  function updateCartCount(delay) {
    setTimeout(function() {
      // Get the current cart count from the cart icon bubble
      var cartCountText = $('.cart-count-bubble span[aria-hidden="true"]').html();

      // Update the #mycount element with the new cart count
      $('#mycount').html(cartCountText);
    }, delay); // Delay passed as an argument
  }

  // Bind event to product form submit button
  $('.product-form__submit').on('click', function() {
    updateCartCount(2000);  // 2 second delay for the form submission
  });

  // Use event delegation for dynamically rendered plus and minus buttons
  $(document).on('click', '.cart-quantity button[name="minus"]', function() {
    updateCartCount(3000);  // 3 second delay for quantity minus
  });

  $(document).on('click', '.cart-quantity button[name="plus"]', function() {
    updateCartCount(3000);  // 3 second delay for quantity plus
  });

   
  $(document).on('click', 'cart-remove-button .button', function() {
    updateCartCount(3000);  // 3 second delay for quantity plus
  });

});

thanks

1 Like

Can you send me a screenshot to show me were to input?

In header.liquid before {% schema %} tags

Not sure if i’m putting it in the wrong place or its just not working

Ok let me do it?

ok let me know what you need

Collaborate code