function buyButtonClickHandler(evt) {
    evt.preventDefault();
    var id = product.selectedVariant.id;
    var quantity;
    var cartLineItem = findCartItemByVariantId(id);

    quantity = cartLineItem ? cartLineItem.quantity + 1 : 1;

    addOrUpdateVariant(product.selectedVariant, quantity);
    setPreviousFocusItem(evt.target);
    $('#checkout').focus();
  }
/* Attach and control listeners onto buy button
  ============================================================ */
Attach and control listeners onto buy button
Attach and control listeners onto buy button
function buyButtonClickHandler(evt) {
    evt.preventDefault();
    var id = product.selectedVariant.id;
    var quantity;
    var cartLineItem = findCartItemByVariantId(id);
    quantity = cartLineItem ? cartLineItem.quantity + 1 : 1;
    addOrUpdateVariant(product.selectedVariant, quantity);
    setPreviousFocusItem(evt.target);
    $('#checkout').focus();
  }
function buyButtonClickHandler ( evt ) { evt . preventDefault ( ) ; var id = product . selectedVariant . id ; var quantity ; var cartLineItem = findCartItemByVariantId ( id ) ; quantity = cartLineItem ? cartLineItem . quantity + 1 : 1 ; addOrUpdateVariant ( product . selectedVariant , quantity ) ; setPreviousFocusItem ( evt . target ) ; $ ( '#checkout' ) . focus ( ) ; }
Attach and control listeners onto buy button
Attach and control listeners onto buy button