Merge pull request 'sorted buyer types in cart popup highest price first' (#15) from staging into master
Reviewed-on: http://localhost:3000/zino/seatmapv2/pulls/15
This commit is contained in:
@@ -7,12 +7,12 @@ import Utils from "./utils";
|
||||
|
||||
export function addItem(inSeatObj: I.JSCSelectedSeat): void {
|
||||
const color: string = `#${XMLHelper.getVenuePricescalePropertyByPricescaleID("color", inSeatObj.data.seatsObj.id[0])}`;
|
||||
const category: string | undefined = Utils.encodeCP850DecodeUTF8( XMLHelper.getVenuePricescalePropertyByPricescaleID("desc", inSeatObj.data.seatsObj.id[0])! );
|
||||
const category: string | undefined = Utils.encodeCP850DecodeUTF8(XMLHelper.getVenuePricescalePropertyByPricescaleID("desc", inSeatObj.data.seatsObj.id[0])!);
|
||||
const seat: string = config.state.layoutRows[inSeatObj.id][5];
|
||||
const row: string = config.state.layoutRows[inSeatObj.id][4];
|
||||
const sectionID: string = config.state.layoutRows[inSeatObj.id][3];
|
||||
const sectionDesc: string | undefined = XMLHelper.getSectionDescBySectionID(sectionID);
|
||||
const seatStr: string | undefined = Utils.encodeCP850DecodeUTF8( `${sectionDesc}<br/>Reihe ${row} Platz ${seat}` );
|
||||
const seatStr: string | undefined = Utils.encodeCP850DecodeUTF8(`${sectionDesc}<br/>Reihe ${row} Platz ${seat}`);
|
||||
const buyerTypes: I.TypeBuyerType = XMLHelper.getBuyerTypesByPricescaleID(inSeatObj.data.seatsObj.id[0]);
|
||||
const cartID: string = `cartItem-${inSeatObj.id}`;
|
||||
const dropdownBuyerTypesSelector: string = `#${cartID} .dropdownBuyerTypes`;
|
||||
@@ -48,7 +48,7 @@ export function changedDropdownBuyerType(inSelect: HTMLSelectElement, inSeatObj:
|
||||
Events.addRedirectCheckout(url);
|
||||
}
|
||||
|
||||
export function calcOverallPrice(): void{
|
||||
export function calcOverallPrice(): void {
|
||||
if (!config.state.selectedSeatsArr.length)
|
||||
config.state.priceOverall = "0";
|
||||
else
|
||||
@@ -113,14 +113,18 @@ function addDropdownBuyerTypeOptions(inBuyerTypes: I.TypeBuyerType, inSelector:
|
||||
if (!inBuyerTypes)
|
||||
return;
|
||||
|
||||
inBuyerTypes.forEach(arr => {
|
||||
console.log(inBuyerTypes);
|
||||
|
||||
inBuyerTypes.sort((a, b) => {
|
||||
return <any>b[1] - <any>a[1];
|
||||
}).forEach(arr => {
|
||||
if (arr[0])
|
||||
appendOption(inSelector, arr)
|
||||
});
|
||||
}
|
||||
|
||||
function appendOption(inSelector: string, inArr: I.TypeBuyerTypeArr): void {
|
||||
const desc: string = Utils.encodeCP850DecodeUTF8( <string>inArr[2] );
|
||||
const desc: string = Utils.encodeCP850DecodeUTF8(<string>inArr[2]);
|
||||
const id: string = <string>inArr[0];
|
||||
const price: string = getPriceInEur(<string>inArr[1]);
|
||||
const dropdownBuyerTypes: HTMLElement = jQuery(inSelector).get(0);
|
||||
|
||||
Reference in New Issue
Block a user