theme updates
This commit is contained in:
@@ -54,8 +54,6 @@ if (!$checkout->is_registration_enabled() && $checkout->is_registration_required
|
||||
</div>
|
||||
<p><strong>Name (Person using the service):</strong><br />
|
||||
{{ subscriber_first_name }} {{ subscriber_last_name }}<br />
|
||||
<strong>Gender:</strong><br />
|
||||
{{ subscriber_gender }}<br />
|
||||
<div class="d-flex justify-content-between">
|
||||
<h4>Subscriber Contact Information</h4>
|
||||
<a href="#" @click.prevent="switchStep">Edit</a>
|
||||
@@ -87,7 +85,7 @@ if (!$checkout->is_registration_enabled() && $checkout->is_registration_required
|
||||
|
||||
<div class="d-flex mt-3">
|
||||
<input class="mt-2 me-2" type="checkbox" v-model="i_agree" />
|
||||
<p>By checking this box, I am confirming that I have read and agree with the <a href="/terms-of-use/" target="_blank">terms of use</a> associated with placing this order. Lifeline values your privacy. Please read our <a href="/privacy-policy/" target="_blank">privacy policy</a> form for more information.</p>
|
||||
<p>I confirm that I have read and agree with the <a href="/terms-of-use/" target="_blank">terms of use</a> associated with placing this order. Please read our <a href="/privacy-policy/" target="_blank">privacy policy</a> form for more information.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -125,6 +123,10 @@ if (!$checkout->is_registration_enabled() && $checkout->is_registration_required
|
||||
|
||||
|
||||
<style>
|
||||
|
||||
#billing_country_field {
|
||||
display: none;
|
||||
}
|
||||
#place_order {
|
||||
border: none;
|
||||
padding: 8px 20px;
|
||||
@@ -159,14 +161,6 @@ tr.woocommerce-shipping-totals {
|
||||
display: none;
|
||||
visibility: hidden;
|
||||
}
|
||||
#caregiver_authorized_field label {
|
||||
line-height: 1.2;
|
||||
cursor: pointer;
|
||||
}
|
||||
#caregiver_authorized_field span {
|
||||
display: none;
|
||||
visibility: hidden;
|
||||
}
|
||||
span.optional {
|
||||
display: none;
|
||||
visibility: hidden;
|
||||
@@ -196,11 +190,10 @@ var cctype = null;
|
||||
|
||||
const app = Vue.createApp({
|
||||
data() {
|
||||
return {
|
||||
return {
|
||||
step: "",
|
||||
subscriber_first_name: "",
|
||||
subscriber_last_name: "",
|
||||
subscriber_gender: "male",
|
||||
subscriber_birthdate: "1950-01-01",
|
||||
subscriber_address_1: "",
|
||||
subscriber_address_2: "",
|
||||
@@ -209,14 +202,13 @@ const app = Vue.createApp({
|
||||
subscriber_state: "",
|
||||
subscriber_email: "",
|
||||
subscriber_phone: "",
|
||||
show_caregiver_form: "true",
|
||||
show_caregiver_form: false,
|
||||
show_caregiver_form_checkbox: false,
|
||||
caregiver_relation: "",
|
||||
caregiver_first_name: "",
|
||||
caregiver_last_name: "",
|
||||
caregiver_email: "",
|
||||
caregiver_phone: "",
|
||||
caregiver_authorized: "false",
|
||||
caregiver_authorized_box: false,
|
||||
card_number: "",
|
||||
expiration_month: "",
|
||||
expiration_year: "",
|
||||
@@ -230,36 +222,36 @@ const app = Vue.createApp({
|
||||
allJQueryFieldsAreGood: false,
|
||||
appliedCoupons: "",
|
||||
form: {
|
||||
cardNumber: null,
|
||||
date: null,
|
||||
|
||||
},
|
||||
options: {
|
||||
creditCard: {
|
||||
creditCard: true,
|
||||
delimiter: '',
|
||||
onCreditCardTypeChanged: function(type) {
|
||||
console.log("onCreditCardTypeChanged", type);
|
||||
if(type=="visa" ){
|
||||
cctype = "Visa";
|
||||
} else if (type=="mastercard") {
|
||||
cctype = "MasterCard";
|
||||
} else if (type=="amex") {
|
||||
cctype = "American Express";
|
||||
} else if (type=="discover") {
|
||||
cctype = "Discover";
|
||||
}
|
||||
document.querySelector('.cc_type').innerHTML = '<input type="hidden" name="creditcard_type" id="creditcard_type" value="'+cctype+'"><img aria-hidden="true" src="/wp-content/themes/lifeline/images/' + type +'.png" style="width: 50px;">';
|
||||
}
|
||||
cardNumber: null,
|
||||
date: null,
|
||||
},
|
||||
date: {
|
||||
date: true,
|
||||
datePattern: ['d', 'm', 'Y'],
|
||||
delimiter: '/',
|
||||
},
|
||||
}
|
||||
options: {
|
||||
creditCard: {
|
||||
creditCard: true,
|
||||
delimiter: '',
|
||||
onCreditCardTypeChanged: function(type) {
|
||||
console.log("onCreditCardTypeChanged", type);
|
||||
if(type=="visa" ){
|
||||
cctype = "Visa";
|
||||
} else if (type=="mastercard") {
|
||||
cctype = "MasterCard";
|
||||
} else if (type=="amex") {
|
||||
cctype = "American Express";
|
||||
} else if (type=="discover") {
|
||||
cctype = "Discover";
|
||||
}
|
||||
document.querySelector('.cc_type').innerHTML = '<input type="hidden" name="creditcard_type" id="creditcard_type" value="'+cctype+'"><img aria-hidden="true" src="/wp-content/themes/lifeline/images/' + type +'.png" style="width: 50px;">';
|
||||
}
|
||||
},
|
||||
date: {
|
||||
date: true,
|
||||
datePattern: ['d', 'm', 'Y'],
|
||||
delimiter: '/',
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
computed: {
|
||||
subscriber_address_preview: function() {
|
||||
var output = this.subscriber_first_name + " " + this.subscriber_last_name + "<br />" + this.subscriber_address_1;
|
||||
@@ -340,7 +332,6 @@ const app = Vue.createApp({
|
||||
output += $("#billing_address_2").val() + "<br />";
|
||||
}
|
||||
output += $("#billing_city").val() + ", " + $("#billing_state").val() + "<br />";
|
||||
output += $("#select2-billing_country-container").text() + "<br />";
|
||||
if ($("#billing_phone").val()) {
|
||||
output += $("#billing_phone").val() + "<br />";
|
||||
}
|
||||
@@ -402,37 +393,15 @@ const app = Vue.createApp({
|
||||
$("body").removeClass("checkout-step-1");
|
||||
}
|
||||
},
|
||||
caregiver_authorized_box: function() {
|
||||
if (this.caregiver_authorized_box) {
|
||||
this.caregiver_authorized = "true";
|
||||
return;
|
||||
}
|
||||
this.caregiver_authorized = "false";
|
||||
}
|
||||
|
||||
},
|
||||
mounted: function() {
|
||||
this.step = "step-1";
|
||||
this.SESSpromoid = "<?= $_SESSION["SESSpromoid"]; ?>";
|
||||
this.SESSpromotion_description = "<?= $_SESSION["SESSpromotion_description"]; ?>";
|
||||
this.SESScoupon_code = "<?= $_SESSION["SESScoupon_code"]; ?>";
|
||||
|
||||
// HACK!!! This will run once a second and if it finds any hidden
|
||||
// coupons in the order review table then it will parse the data and set
|
||||
// the vue data prop so that it can be shown how we want it to be shown
|
||||
var self = this;
|
||||
setInterval(function() {
|
||||
if ($(".cart-discount").length === 0) {
|
||||
self.appliedCoupons = "";
|
||||
return;
|
||||
}
|
||||
|
||||
self.appliedCoupons = "";
|
||||
$(".cart-discount").each(function() {
|
||||
var couponTitle = $(this).children("th").text();
|
||||
var couponDesc = $(this).children("td").text();
|
||||
self.appliedCoupons = self.appliedCoupons + couponTitle + "<br />" + couponDesc + "<br />";
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
})
|
||||
|
||||
@@ -441,3 +410,59 @@ app.use(VueCleave);
|
||||
app.mount('#v-app');
|
||||
</script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js"></script>
|
||||
<script>
|
||||
function copySubscriberAddress() {
|
||||
var subscriberFirstName = document.getElementById("subscriber_first_name").value;
|
||||
var subscriberLastName = document.getElementById("subscriber_last_name").value;
|
||||
var subscriberAddress1 = document.getElementById("subscriber_address_1").value;
|
||||
var subscriberAddress2 = document.getElementById("subscriber_address_2").value;
|
||||
var subscriberCity = document.getElementById("subscriber_city").value;
|
||||
var subscriberState = document.getElementById("subscriber_state").value;
|
||||
var subscriberZip = document.getElementById("subscriber_zip").value;
|
||||
var subscriberEmail = document.getElementById("subscriber_email").value;
|
||||
var subscriberPhone = document.getElementById("subscriber_phone").value;
|
||||
var billingFirstName = document.getElementById("billing_first_name");
|
||||
var billingLastName = document.getElementById("billing_last_name");
|
||||
var billingAddress1 = document.getElementById("billing_address_1");
|
||||
var billingAddress2 = document.getElementById("billing_address_2");
|
||||
var billingCity = document.getElementById("billing_city");
|
||||
var billingState = document.getElementById("billing_state");
|
||||
var billingZip = document.getElementById("billing_postcode");
|
||||
var billingEmail = document.getElementById("billing_email");
|
||||
var billingPhone = document.getElementById("billing_phone");
|
||||
|
||||
if (document.getElementById("sameAsSubscriber").checked) {
|
||||
billingFirstName.value = subscriberFirstName;
|
||||
billingLastName.value = subscriberLastName;
|
||||
billingAddress1.value = subscriberAddress1;
|
||||
billingAddress2.value = subscriberAddress2;
|
||||
billingCity.value = subscriberCity;
|
||||
billingState.value = subscriberState;
|
||||
billingZip.value = subscriberZip;
|
||||
billingEmail.value = subscriberEmail;
|
||||
billingPhone.value = subscriberPhone;
|
||||
|
||||
$('#billing_state').val(subscriberState).trigger('change');
|
||||
} else {
|
||||
billingFirstName.value = "";
|
||||
billingLastName.value = "";
|
||||
billingAddress1.value = "";
|
||||
billingAddress2.value = "";
|
||||
billingCity.value = "";
|
||||
billingState.value = "";
|
||||
billingZip.value = "";
|
||||
billingEmail.value = "";
|
||||
billingPhone.value = "";
|
||||
|
||||
$('#billing_state').val('').trigger('change');
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
|
||||
$('#billing_state').select2();
|
||||
|
||||
document.getElementById("sameAsSubscriber").addEventListener("change", copySubscriberAddress);
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user