Actualizar el contador del carrito, cuando se usa ajax
function update_cart_count($fragments) { $link = '<li id="shopping-cart-header" class="float-left"><a href="' . get_permalink(9) . '"><i class="fas fa-shopping-cart"></i> ' . WC()->cart->get_cart_contents_count() . ' Mi carro</a></li>'; $fragments['li#shopping-cart-header'] = $link; return $fragments; } add_filter('woocommerce_add_to_cart_fragments', 'update_cart_count');