@ -1,7 +1,7 @@
< script src = "https://www.recaptcha.net/recaptcha/enterprise.js?render=6Lf828MhAAAAANNetijCXKwW5ARyhcJ-b1Hhslja" > < / script >
< div class = "tmbottom" >
< h3 style = "text-align: center; font-size: 20px; line-height: 22px;" > Book this trip now. Your 1:1 travel consultant will reply within 1 working day.< / h3 >
< form action = "https://www.asiahighlights.com/orders/ quick_inquiry _save" method = "post" novalidate = "" id = 'gp_form' >
< form action = "https://www.asiahighlights.com/orders/ lantern _save" method = "post" novalidate = "" id = 'gp_form' >
< textarea id = "form_additionalrequirements" name = "additional_requirements" placeholder = "If you have other requirements such as adding private transport on arrival and departure day, extending the trip : pre - or post-tour, please let us know .... (optional)" > < / textarea >
< div class = "selectionBlock" >
< div id = "adultBlock" >
@ -12,7 +12,7 @@
< / p >
< div class = "numberBtn" >
< input class = "minaddBtn reduceadult" id = "minusAdult" type = "button" value = "-" >
< input class = "number" type = "text" id = "adultNumber" readonly value = "1" name = "adult _8_plus_yrs ">
< input class = "number" type = "text" id = "adultNumber" readonly value = "1" name = "adult ">
< input class = "minaddBtn addadult" id = "plusAdult" type = "button" value = "+" >
< / div >
< / div >
@ -29,7 +29,7 @@
< / div >
< / div >
< / div >
< input class = "FullName" id = "realname" name = " name" placeholder = "Your name *" required = "" type = "text" value = "" / >
< input class = "FullName" id = "realname" name = " full name" placeholder = "Your name *" required = "" type = "text" value = "" / >
< div id = "realname_errmsg" style = "display: none" >
< div class = "requiredArea" style = "margin-top:-10px;" > Please enter your name.< / div >
< / div >
@ -331,6 +331,7 @@
< button class = "sendButton" id = "submit_gp_form" type = "button" > Inquire Now< / button >
< input name = "total_price" id = "totalPriceHidden" type = "hidden" value = "10000" / >
< input name = "product_code" type = "hidden" value = " <?php echo $meta_product_code ; ?> " />
< input name = "itinerary" type = "hidden" value = " <?php echo $information -> ic_title ; ?> " />
< / form >
@ -377,6 +378,16 @@
const minusAdultBtn = el('minusAdult');
const plusKidBtn = el('plusKid');
const minusKidBtn = el('minusKid');
const totalPriceHidden = el("totalPriceHidden");
function calcTotalPrice(ticketPrice, adultNumber) {
var totalPrice = ticketPrice * adultNumber;
if (adultNumber >= 10) {
totalPrice = totalPrice * 0.95;
}
return totalPrice.toFixed(2);
}
plusAdultBtn.on('click', () => {
adultNumberValue++;
@ -441,7 +452,10 @@
const gp_form = el('gp_form');
submitFormBtn.on('click', () => {
if (validateGPForm()) {
var ticketPrice = 139;
var totalPrice = calcTotalPrice(ticketPrice, adultNumberValue);
totalPriceHidden.value = totalPrice;
if (typeof(grecaptcha) === "undefined") {
console.warn('grecaptcha is disabled.');
gp_form.submit();
@ -462,4 +476,4 @@
});
})(document);
< / script >
< / script >