Conditional Fields

This topic contains 6 replies, has 3 voices, and was last updated by  Jason Farran 6 years, 11 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #14297

    Hi, does the latest release include conditional fields and if so could someone point me in the right direction re how to implement?

    Thanks

    Jo Clarke
    #14307

    Hi Jo,

    I’ve just replied to your e-mail. Conditional logic is going to be introduced in stages over the next two updates 1.10 and 1.11 (with the latter including the UI, 1.10 will expose an API).

    However, form what you said in the e-mail this won’t go far enough to meet what you want to achieve, the conditional logic will be limited to showing/hiding fields if certain criteria are (or are not) met.

    Stephen Harris
    #27266

    Were conditional fields ever added? I just purchased the Pro with all add ons and don’t see any conditional settings.

    I’m looking to add a condition that if an event is full, people can be added to a “waiting list,” as well as a few other conditions.

    Jason Farran
    #27267

    Hi Jason,

    It is possible to add conditional fields, but currently this can only be done via the API and not the user interface: https://wp-event-organiser.com/blog/announcements/event-organiser-pro-1-10-0/

    I’d be happy to assist you in setting that up, however, to clarify, ‘conditional’ here means showing/hiding booking form fields based on the value of other fields in the booking form. It doesn’t cover a waiting list feature.

    Pro doesn’t provide a waiting list feature, and implementing one might be difficult because the plug-in’s default behaviour is to prevent users from selecting tickets that have sold out.

    Stephen Harris
    #27268

    Got it. Yes, I want hide/show functionality. I guess I’ll have to see if I can get around the sold out to display a link to a “waiting list” form.

    Jason Farran
    #27278

    If it is just a link to a waiting list form, then you can simply use the filter eventorganiser_booking_tickets_sold_out:

    add_filter( 'eventorganiser_booking_tickets_sold_out', function() {
        return '<a href="www.yoursite.com/your/link">Your message here.</a>';
    } );
    

    The returned value is treated as HTML. Or you can edit the template event-organiser-pro/templates/eo-booking-form.php.

    That should go in a utility plugin or theme’s functions.php

    Stephen Harris
    #27280

    Yeah, that’s what I did. Re-wrote the filter to add a waiting list form if the event is sold out. I think that will work for the client.

    Jason Farran
Viewing 7 posts - 1 through 7 (of 7 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.