first commit
This commit is contained in:
45
wp-content/themes/Divi/custom-code.js
Normal file
45
wp-content/themes/Divi/custom-code.js
Normal file
@@ -0,0 +1,45 @@
|
||||
jQuery(function($) {
|
||||
if($('.woocommerce form.woocommerce-checkout #customer_details').length) {
|
||||
let fieldsData = $('.col-2', this)
|
||||
|
||||
let paragon_field = $('#order_paragon_field', fieldsData)
|
||||
let faktura_field = $('#order_faktura_field', fieldsData)
|
||||
|
||||
let nazwa_firmy_field = $('#order_nazwa_firmy_field', fieldsData)
|
||||
let nip_field = $('#order_nip_field', fieldsData)
|
||||
let ulica_field = $('#order_ulica_field', fieldsData)
|
||||
let kod_pocztowy_field = $('#order_kod_pocztowy_field', fieldsData)
|
||||
let miasto_field = $('#order_miasto_field', fieldsData)
|
||||
|
||||
//* Checkbox auto check paragon
|
||||
$('#order_paragon', paragon_field).prop('checked', true);
|
||||
faktura_fields_disabled()
|
||||
|
||||
//* Checkbox handlers
|
||||
paragon_field.on('click', function() {
|
||||
$('#order_paragon', paragon_field).prop('checked', true);
|
||||
$('#order_faktura', faktura_field).prop('checked', false);
|
||||
faktura_fields_disabled()
|
||||
})
|
||||
faktura_field.on('click', function() {
|
||||
$('#order_paragon', paragon_field).prop('checked', false);
|
||||
$('#order_faktura', faktura_field).prop('checked', true);
|
||||
faktura_fields_active()
|
||||
})
|
||||
|
||||
function faktura_fields_active() {
|
||||
nazwa_firmy_field.show()
|
||||
nip_field.show()
|
||||
ulica_field.show()
|
||||
kod_pocztowy_field.show()
|
||||
miasto_field.show()
|
||||
}
|
||||
function faktura_fields_disabled() {
|
||||
nazwa_firmy_field.hide()
|
||||
nip_field.hide()
|
||||
ulica_field.hide()
|
||||
kod_pocztowy_field.hide()
|
||||
miasto_field.hide()
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user