fixed not refreshing checkouturl on highest buyer type sort
This commit is contained in:
@@ -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 => {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export function addModalCart(): void {
|
|||||||
export function addRedirectCheckout(inUrl: string | undefined): void {
|
export function addRedirectCheckout(inUrl: string | undefined): void {
|
||||||
if (!inUrl)
|
if (!inUrl)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const btnCheckout = jQuery("#modalCart-overlay #checkout .fl-button").get(0);
|
const btnCheckout = jQuery("#modalCart-overlay #checkout .fl-button").get(0);
|
||||||
if (btnCheckout) {
|
if (btnCheckout) {
|
||||||
btnCheckout.addEventListener("click", () => {
|
btnCheckout.addEventListener("click", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user