diff --git a/client/src/modules/cart.ts b/client/src/modules/cart.ts index d5eb346..74c60f4 100644 --- a/client/src/modules/cart.ts +++ b/client/src/modules/cart.ts @@ -17,12 +17,10 @@ export function addItem(inSeatObj: I.JSCSelectedSeat): void { const cartID: string = `cartItem-${inSeatObj.id}`; const dropdownBuyerTypesSelector: string = `#${cartID} .dropdownBuyerTypes`; - console.log(category); - console.log(seatStr); - appendHTML(cartID, color, category, seatStr); addDropdownBuyerTypeOptions(buyerTypes, dropdownBuyerTypesSelector); Events.addCartDropdownBuyerTypes(dropdownBuyerTypesSelector, inSeatObj); + jQuery(".dropdownBuyerTypes").trigger("change"); // refresh cart because of highest buyer type sort } export function removeCartItems(): void { @@ -32,9 +30,7 @@ export function removeCartItems(): void { } export function changedDropdownBuyerType(inSelect: HTMLSelectElement, inSeatObj: I.JSCSelectedSeat): void { - const index: number = config.state.selectedSeatsArr.findIndex(arr => - arr[0] === inSeatObj.id); - + const index: number = config.state.selectedSeatsArr.findIndex(arr => arr[0] === inSeatObj.id); config.state.selectedSeatsArr[index][1] = inSelect.value; const buyerTypeCode = XMLHelper.getBuyerTypeCodeByBuyerTypeID(inSelect.value); @@ -43,7 +39,6 @@ export function changedDropdownBuyerType(inSelect: HTMLSelectElement, inSeatObj: calcOverallPrice(); CartButtons.setBtnCartText(); - const url = generateCheckoutUrl(); Events.addRedirectCheckout(url); } @@ -113,8 +108,6 @@ function addDropdownBuyerTypeOptions(inBuyerTypes: I.TypeBuyerType, inSelector: if (!inBuyerTypes) return; - console.log(inBuyerTypes); - inBuyerTypes.sort((a, b) => { return b[1] - a[1]; }).forEach(arr => { diff --git a/client/src/modules/events.ts b/client/src/modules/events.ts index e909fca..c8cf591 100644 --- a/client/src/modules/events.ts +++ b/client/src/modules/events.ts @@ -44,7 +44,7 @@ export function addModalCart(): void { export function addRedirectCheckout(inUrl: string | undefined): void { if (!inUrl) return; - + const btnCheckout = jQuery("#modalCart-overlay #checkout .fl-button").get(0); if (btnCheckout) { btnCheckout.addEventListener("click", () => {