function updateCartMenuItemCount( event, fragments, cart_hash, $button ) {
			var key = 'div.widget_shopping_cart_content';

			if ( key in fragments ) {
				// initialize cart items sum count with 0
				var products = 0;

				// loop through every item in cart and sum up the quantity
				$( fragments[key] ).find( '.mini_cart_item' ).each( function(i, obj) {
					var $quantity = $( obj ).find( '.quantity' );

					// remove the price html tag to be able to parse number of items for that product
					$quantity.children().remove();
					products += parseInt( $quantity.text(), 10 );
				});

				// actually update the cart items count
				$( '.menu-item--cart .cart-count span' ).text( products );
			}
		}
// update cart items count in cart menu item
update cart items count in cart menu item
update cart items count in cart menu item
function updateCartMenuItemCount( event, fragments, cart_hash, $button ) {
			var key = 'div.widget_shopping_cart_content';
			if ( key in fragments ) {
				var products = 0;
				$( fragments[key] ).find( '.mini_cart_item' ).each( function(i, obj) {
					var $quantity = $( obj ).find( '.quantity' );
					$quantity.children().remove();
					products += parseInt( $quantity.text(), 10 );
				});
				$( '.menu-item--cart .cart-count span' ).text( products );
			}
		}
function updateCartMenuItemCount ( event , fragments , cart_hash , $button ) { var key = 'div.widget_shopping_cart_content' ; if ( key in fragments ) { var products = 0 ; $ ( fragments [ key ] ) . find ( '.mini_cart_item' ) . each ( function ( i , obj ) { var $quantity = $ ( obj ) . find ( '.quantity' ) ; $quantity . children ( ) . remove ( ) ; products += parseInt ( $quantity . text ( ) , 10 ) ; } ) ; $ ( '.menu-item--cart .cart-count span' ) . text ( products ) ; } }
update cart items count in cart menu item
update cart items count in cart menu item
// initialize cart items sum count with 0 // loop through every item in cart and sum up the quantity // remove the price html tag to be able to parse number of items for that product // actually update the cart items count