function addOrUpdateVariant(variant, quantity) {
    openCart();
    var cartLineItem = findCartItemByVariantId(variant.id);

    if (cartLineItem) {
      updateVariantInCart(cartLineItem, quantity);
    } else {
      addVariantToCart(variant, quantity);
    }

    updateCartTabButton();
  }
/* Determine action for variant adding/updating/removing
  ============================================================ */
Determine action for variant adding/updating/removing
Determine action for variant adding / updating / removing
function addOrUpdateVariant(variant, quantity) {
    openCart();
    var cartLineItem = findCartItemByVariantId(variant.id);
    if (cartLineItem) {
      updateVariantInCart(cartLineItem, quantity);
    } else {
      addVariantToCart(variant, quantity);
    }
    updateCartTabButton();
  }
function addOrUpdateVariant ( variant , quantity ) { openCart ( ) ; var cartLineItem = findCartItemByVariantId ( variant . id ) ; if ( cartLineItem ) { updateVariantInCart ( cartLineItem , quantity ) ; } else { addVariantToCart ( variant , quantity ) ; } updateCartTabButton ( ) ; }
Determine action for variant adding/updating/removing
Determine action for variant adding / updating / removing