fixed not refreshing checkouturl on highest buyer type sort

This commit is contained in:
zino
2021-07-28 15:16:12 +02:00
parent 28554886ff
commit 269b982575
2 changed files with 3 additions and 10 deletions

View File

@@ -17,12 +17,10 @@ export function addItem(inSeatObj: I.JSCSelectedSeat): void {
const cartID: string = `cartItem-${inSeatObj.id}`; const cartID: string = `cartItem-${inSeatObj.id}`;
const dropdownBuyerTypesSelector: string = `#${cartID} .dropdownBuyerTypes`; const dropdownBuyerTypesSelector: string = `#${cartID} .dropdownBuyerTypes`;
console.log(category);
console.log(seatStr);
appendHTML(cartID, color, category, seatStr); appendHTML(cartID, color, category, seatStr);
addDropdownBuyerTypeOptions(buyerTypes, dropdownBuyerTypesSelector); addDropdownBuyerTypeOptions(buyerTypes, dropdownBuyerTypesSelector);
Events.addCartDropdownBuyerTypes(dropdownBuyerTypesSelector, inSeatObj); Events.addCartDropdownBuyerTypes(dropdownBuyerTypesSelector, inSeatObj);
jQuery(".dropdownBuyerTypes").trigger("change"); // refresh cart because of highest buyer type sort
} }
export function removeCartItems(): void { export function removeCartItems(): void {
@@ -32,9 +30,7 @@ export function removeCartItems(): void {
} }
export function changedDropdownBuyerType(inSelect: HTMLSelectElement, inSeatObj: I.JSCSelectedSeat): void { export function changedDropdownBuyerType(inSelect: HTMLSelectElement, inSeatObj: I.JSCSelectedSeat): void {
const index: number = config.state.selectedSeatsArr.findIndex(arr => const index: number = config.state.selectedSeatsArr.findIndex(arr => arr[0] === inSeatObj.id);
arr[0] === inSeatObj.id);
config.state.selectedSeatsArr[index][1] = inSelect.value; config.state.selectedSeatsArr[index][1] = inSelect.value;
const buyerTypeCode = XMLHelper.getBuyerTypeCodeByBuyerTypeID(inSelect.value); const buyerTypeCode = XMLHelper.getBuyerTypeCodeByBuyerTypeID(inSelect.value);
@@ -43,7 +39,6 @@ export function changedDropdownBuyerType(inSelect: HTMLSelectElement, inSeatObj:
calcOverallPrice(); calcOverallPrice();
CartButtons.setBtnCartText(); CartButtons.setBtnCartText();
const url = generateCheckoutUrl(); const url = generateCheckoutUrl();
Events.addRedirectCheckout(url); Events.addRedirectCheckout(url);
} }
@@ -113,8 +108,6 @@ function addDropdownBuyerTypeOptions(inBuyerTypes: I.TypeBuyerType, inSelector:
if (!inBuyerTypes) if (!inBuyerTypes)
return; return;
console.log(inBuyerTypes);
inBuyerTypes.sort((a, b) => { inBuyerTypes.sort((a, b) => {
return <any>b[1] - <any>a[1]; return <any>b[1] - <any>a[1];
}).forEach(arr => { }).forEach(arr => {