Thank you for reaching out to us.
At the moment, the Name and Email fields are mandatory in the Guest-Checkout-Fields and cannot be removed. That’s why they appear alongside the Event-Checkout-Fields, which may cause some duplication.
We do understand this can feel repetitive, and our team is already reviewing ways to improve the process in future updates so that duplicate fields can be avoided.
If you have any further questions, please don’t hesitate to reach out to us.
Claude made me a code to put the “firstname” and “lastname” entries in the corresponding guest-booking-fields. Maybe that helps some of you.
add_action('wp_footer', 'sync_booking_fields_script');
function sync_booking_fields_script() {
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
function syncFields() {
var vornameField = $('input[name="ep_booking_booking_fields[1][vorname]"]');
var firstNameField = $('input[name="ep_booking_guest_booking_field[ep_gb_first_name]"]');
var nachnameField = $('input[name="ep_booking_booking_fields[2][nachname]"]');
var lastNameField = $('input[name="ep_booking_guest_booking_field[ep_gb_last_name]"]');
vornameField.on('input keyup change', function() {
firstNameField.val($(this).val());
});
nachnameField.on('input keyup change', function() {
lastNameField.val($(this).val());
});
if (vornameField.val()) {
firstNameField.val(vornameField.val());
}
if (nachnameField.val()) {
lastNameField.val(nachnameField.val());
}
}
syncFields();
setTimeout(syncFields, 1000);
$(document).ajaxComplete(function() {
syncFields();
});
});
</script>
<?php
}
add_action('init', 'sync_booking_fields_on_submit');
function sync_booking_fields_on_submit() {
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($_POST['ep_booking_booking_fields'][1]['vorname'])) {
$_POST['ep_booking_guest_booking_field']['ep_gb_first_name'] =
$_POST['ep_booking_booking_fields'][1]['vorname'];
}
if (isset($_POST['ep_booking_booking_fields'][2]['nachname'])) {
$_POST['ep_booking_guest_booking_field']['ep_gb_last_name'] =
$_POST['ep_booking_booking_fields'][2]['nachname'];
}
}
}
Hi @flexkeller
Thanks for the code.
We have forwarded this to our development team for further action and consideration.