jQuery(document).ready(function($) {
$(document.body).on('added_to_cart', function() {
// Wait a moment for AJAX to update the cart
setTimeout(function() {
const count = $('.cart-count').text();
console.log('Cart count updated:', count);
}, 500); // slight delay to allow AJAX fragment to update
});
});