• Resolved flexkeller

    (@flexkeller)


    How can I prevent “Event-Checkout-Fields,” such as Name, Email, and Phone, from being requested again in the “Guest-Checkout-Fields”?

    If I only include the fields in the “Event-Checkout-Fields,” the Name and Email are still requested again, which is annoying because the customer has to enter their Name and Email twice.

    If I only include the fields in the “Guest-Checkout-Fields,” they are not requested for logged-in users.


Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support epsupport

    (@epsupport)

    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.

    Thread Starter flexkeller

    (@flexkeller)

    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'];
    }
    }
    }
    Plugin Support epsupport1

    (@epsupport1)

    Hi @flexkeller

    Thanks for the code.

    We have forwarded this to our development team for further action and consideration.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Checkout fields twice…’ is closed to new replies.