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>
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/**
|
||||
* Checkout shipping information form
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-shipping.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://woo.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.6.0
|
||||
* @global WC_Checkout $checkout
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
?>
|
||||
<div class="woocommerce-shipping-fields">
|
||||
<?php if ( true === WC()->cart->needs_shipping_address() ) : ?>
|
||||
|
||||
<div class="d-flex justify-content-between" id="ship-to-different-address" style="font-size: 22px; color: rgb(80, 80, 80);">
|
||||
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox">
|
||||
<input id="ship-to-different-address-checkbox" class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" <?php checked( apply_filters( 'woocommerce_ship_to_different_address_checked', 'shipping' === get_option( 'woocommerce_ship_to_destination' ) ? 1 : 0 ), 1 ); ?> type="checkbox" name="ship_to_different_address" value="1" /> <span><?php esc_html_e( 'Ship to a different address?', 'woocommerce' ); ?></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="shipping_address">
|
||||
|
||||
<?php do_action( 'woocommerce_before_checkout_shipping_form', $checkout ); ?>
|
||||
|
||||
<div class="woocommerce-shipping-fields__field-wrapper">
|
||||
<?php
|
||||
$fields = $checkout->get_checkout_fields( 'shipping' );
|
||||
|
||||
foreach ( $fields as $key => $field ) {
|
||||
woocommerce_form_field( $key, $field, $checkout->get_value( $key ) );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'woocommerce_after_checkout_shipping_form', $checkout ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="woocommerce-additional-fields">
|
||||
<?php do_action( 'woocommerce_before_order_notes', $checkout ); ?>
|
||||
|
||||
<?php if ( apply_filters( 'woocommerce_enable_order_notes_field', 'yes' === get_option( 'woocommerce_enable_order_comments', 'yes' ) ) ) : ?>
|
||||
|
||||
<?php if ( ! WC()->cart->needs_shipping() || wc_ship_to_billing_address_only() ) : ?>
|
||||
|
||||
<h3><?php esc_html_e( 'Additional information', 'woocommerce' ); ?></h3>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="woocommerce-additional-fields__field-wrapper">
|
||||
<?php foreach ( $checkout->get_checkout_fields( 'order' ) as $key => $field ) : ?>
|
||||
<?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_after_order_notes', $checkout ); ?>
|
||||
</div>
|
||||
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* Order Customer Details
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/order/order-details-customer.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 8.7.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
$show_shipping = ! wc_ship_to_billing_address_only() && $order->needs_shipping_address();
|
||||
?>
|
||||
<section class="woocommerce-customer-details">
|
||||
|
||||
<?php if ( $show_shipping ) : ?>
|
||||
|
||||
<section class="woocommerce-columns woocommerce-columns--2 woocommerce-columns--addresses col2-set addresses">
|
||||
<div class="woocommerce-column woocommerce-column--1 woocommerce-column--billing-address col-1">
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<h2 class="woocommerce-column__title"><?php esc_html_e( 'Billing address', 'woocommerce' ); ?></h2>
|
||||
|
||||
<address>
|
||||
<?php echo wp_kses_post( $order->get_formatted_billing_address( esc_html__( 'N/A', 'woocommerce' ) ) ); ?>
|
||||
|
||||
<?php if ( $order->get_billing_phone() ) : ?>
|
||||
<p class="woocommerce-customer-details--phone"><?php echo esc_html( $order->get_billing_phone() ); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $order->get_billing_email() ) : ?>
|
||||
<p class="woocommerce-customer-details--email"><?php echo esc_html( $order->get_billing_email() ); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Action hook fired after an address in the order customer details.
|
||||
*
|
||||
* @since 8.7.0
|
||||
* @param string $address_type Type of address (billing or shipping).
|
||||
* @param WC_Order $order Order object.
|
||||
*/
|
||||
do_action( 'woocommerce_order_details_after_customer_address', 'billing', $order );
|
||||
?>
|
||||
</address>
|
||||
|
||||
<?php if ( $show_shipping ) : ?>
|
||||
|
||||
</div><!-- /.col-1 -->
|
||||
|
||||
<div class="woocommerce-column woocommerce-column--2 woocommerce-column--shipping-address col-2">
|
||||
<h2 class="woocommerce-column__title"><?php esc_html_e( 'Shipping address', 'woocommerce' ); ?></h2>
|
||||
<address>
|
||||
<?php echo wp_kses_post( $order->get_formatted_shipping_address( esc_html__( 'N/A', 'woocommerce' ) ) ); ?>
|
||||
|
||||
<?php if ( $order->get_shipping_phone() ) : ?>
|
||||
<p class="woocommerce-customer-details--phone"><?php echo esc_html( $order->get_shipping_phone() ); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Action hook fired after an address in the order customer details.
|
||||
*
|
||||
* @since 8.7.0
|
||||
* @param string $address_type Type of address (billing or shipping).
|
||||
* @param WC_Order $order Order object.
|
||||
*/
|
||||
do_action( 'woocommerce_order_details_after_customer_address', 'shipping', $order );
|
||||
?>
|
||||
</address>
|
||||
</div><!-- /.col-2 -->
|
||||
|
||||
</section><!-- /.col2-set -->
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_order_details_after_customer_details', $order ); ?>
|
||||
|
||||
</section>
|
||||
Reference in New Issue
Block a user