File: D:/HostingSpaces/netwerkbrabant/netwerkbrabant.nl/resources/assets/js/site/paymentFormHandler.js
/* ==========================================================================
Payment forms Handler
========================================================================== */
const PaymentFormHandler = {
registerForm: null,
otherInvoiceAddress: false,
init: function () {
PaymentFormHandler.registerForm = document.querySelector('.payment-form');
if(isset(PaymentFormHandler.registerForm)){
// Shipping Address area checkbox
const invoiceAddressCheckbox = PaymentFormHandler.registerForm.querySelector('#other_invoice_address');
invoiceAddressCheckbox.addEventListener('change', function () {
const invoiceAreaFieldsWrapper = PaymentFormHandler.registerForm.querySelector('.invoice-information');
if(invoiceAddressCheckbox.checked){
invoiceAreaFieldsWrapper.classList.remove('invoice-information--hidden');
PaymentFormHandler.otherInvoiceAddress = true;
}
else{
invoiceAreaFieldsWrapper.classList.add('invoice-information--hidden');
PaymentFormHandler.otherInvoiceAddress = false;
}
});
}
},
};
PaymentFormHandler.init();