上线 AH-TOUR-LIST-FORM 标签

hotfix/paypal-note
Jimmy Liow 2 years ago
parent 0d9c8dfb8a
commit dda175fe27

@ -1328,6 +1328,14 @@ class Information extends CI_Controller
);
$information->ic_content = str_replace('<!--@GP-FORM@-->', $gp_form_content, $information->ic_content);
// tour-list 表单
$tour_list_form_content = $this->load->view(
$template_path . '-tour-list-form',
array('meta_product_code' => $meta_product_code, 'information' => $information),
true
);
$information->ic_content = str_replace('<!--@TOUR-LIST-FORM@-->', $tour_list_form_content, $information->ic_content);
// 水灯节 GP 线路表单
$gp_form_content = $this->load->view(
$template_path . '-lantern-festival-gp-form',

@ -5,8 +5,8 @@
<div class="list_tmbottom">
<h3 style="text-align:center;">Start planning your tailor-made tour now. Your 1:1 travel consultant will reply within 1 working day.</h3>
<form action="/orders/quick_inquiry_save" method="post" novalidate="" id="info_page_form">
<textarea id="form_additionalrequirements" name="additional_requirements" placeholder="Tell us your travel requirements here: anniversary, honeymoon, family trip, birthday travel, beach, food... (optional)" style="height:100px;"></textarea>
<form action="/orders/quick_inquiry_save" method="post" novalidate="" id="tour_list_form">
<textarea name="additional_requirements" placeholder="Tell us your travel requirements here: anniversary, honeymoon, family trip, birthday travel, beach, food... (optional)" style="height:100px;"></textarea>
<div class="selectionBlock">
<h4>
@ -453,7 +453,7 @@
</div>
<button class="sendButton" id="info_page_button" name="booking_form_inquiry_list" type="button">Inquire Now</button> <input name="product_code" type="hidden" value="<?php echo $meta_product_code; ?>"/>
<button class="sendButton" id="tour_list_button" name="tour_list_button" type="button">Inquire Now</button> <input name="product_code" type="hidden" value="<?php echo $meta_product_code; ?>"/>
<input name="itinerary" type="hidden" value="<?php echo $information->ic_title; ?>" />
</form>
<!--
@ -477,15 +477,15 @@ document.addEventListener('DOMContentLoaded', () => {
minDate: "today"
});
var info_page_button = document.getElementById("info_page_button");
var info_page_form = document.getElementById("info_page_form");
var tour_list_button = document.getElementById("tour_list_button");
var tour_list_form = document.getElementById("tour_list_form");
info_page_button.addEventListener('click', function(event) {
tour_list_button.addEventListener('click', function(event) {
var validateResult = validateQuickInquiryForm();
if (validateResult) {
if (typeof(grecaptcha) === "undefined") {
console.warn('grecaptcha is disabled.');
info_page_form.submit();
tour_list_form.submit();
} else {
grecaptcha.enterprise.ready(async () => {
const token = await grecaptcha.enterprise.execute('6Lf828MhAAAAANNetijCXKwW5ARyhcJ-b1Hhslja', {action: 'ADD_TO_CART'});
@ -493,9 +493,9 @@ document.addEventListener('DOMContentLoaded', () => {
el.type = "hidden";
el.name = "__grecaptcha_token__";
el.value = token;
info_page_form.appendChild(el);
info_page_form.submit();
info_page_button.innerText = "Submitted successfully";
tour_list_form.appendChild(el);
tour_list_form.submit();
tour_list_button.innerText = "Submitted successfully";
});
}
}

Loading…
Cancel
Save