function updateQuantity(fn, variantId) {
    var variant = product.variants.filter(function (variant) {
      return (variant.id === variantId);
    })[0];
    var quantity;
    var cartLineItem = findCartItemByVariantId(variant.id);
    if (cartLineItem) {
      quantity = fn(cartLineItem.quantity);
      updateVariantInCart(cartLineItem, quantity);
    }
  }
/* Update product variant quantity in cart
  ============================================================ */
Update product variant quantity in cart
Update product variant quantity in cart
function updateQuantity(fn, variantId) {
    var variant = product.variants.filter(function (variant) {
      return (variant.id === variantId);
    })[0];
    var quantity;
    var cartLineItem = findCartItemByVariantId(variant.id);
    if (cartLineItem) {
      quantity = fn(cartLineItem.quantity);
      updateVariantInCart(cartLineItem, quantity);
    }
  }
function updateQuantity ( fn , variantId ) { var variant = product . variants . filter ( function ( variant ) { return ( variant . id === variantId ) ; } ) [ 0 ] ; var quantity ; var cartLineItem = findCartItemByVariantId ( variant . id ) ; if ( cartLineItem ) { quantity = fn ( cartLineItem . quantity ) ; updateVariantInCart ( cartLineItem , quantity ) ; } }
Update product variant quantity in cart
Update product variant quantity in cart