Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    pro hooks into the actions and filters in the EM plugin. remember that Pro is an add-on too, so no hacking is needed on your part either.

    note that pro does all this out the box with a form editor.

    Thread Starter Compute

    (@compute)

    As I’m not using pro im wondering how to do this from my own functions.php

    Thread Starter Compute

    (@compute)

    Finally!

    Added my fields in booking-fields.php

    Hooked into em_booking_add saved my field

    if( ! empty( $_REQUEST['company'] ) ){
    		$EM_Booking->booking_meta['registration']['company'] = wp_kses( $_REQUEST['company'], array() );
    	}

    Will now also be saved ??
    I’m still trying to add some validation to my custom fields if anyone knows what/how to hook that?

    adzay

    (@adzay)

    Hi Compute,

    Is ‘Company’ your custom field? How did you add them?

    I have been looking for help on this for a long time.

    agelonwl

    (@angelonwl)

    hi @adzay

    custom booking form is available to pro versions only – https://wp-events-plugin.com/documentation/custom-booking-forms/

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    @compute, you could try hooking into em_booking_validate

    Thread Starter Compute

    (@compute)

    Sorry I never closed this thread.
    As Marcus said, hook into em_booking_validate and it’ll Work.

    I want to buy Pro. Is there a guarantee that the form editor will work with custom fields that I have created using the plugin “Advanced custom fields” ?

    And that I will be able to re-order them?

    Thanks

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    We can’t guarantee that it’ll work with every plugin, however as far as I’m aware the only issue with ACF are related to event/location custom fields. Haven’t heard of issues with the booking forms.

    That said, our user fields interact with the wp_users database, so any plugin storing information on there in a plaintext method should be able to be used with ours. You can reorder fields in the booking form.

    Hi Marcus,

    That’s unfortunate, because I need it to give my users the ability to create events/Locations. The issues that others had, were there any workarounds?

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    at the moment none I’m aware of, but you can already test that out with the free version, since Pro doesn’t mess with event/loaction custom fields, that’s part of the main/free plugin

    Dang, thanks for telling me that. That was the main reason why I wanted to purchase the pro version today ( I will soon though, when my site is ready to make booking payments).

    I’ve seen on other posts you guys have been a bit reluctant on teaching people about hooks ( I know its a burden to teach people things online) .But seeing as learning is my only option, is there any chance of you guys dropping ONE example of a Full hook ( not just “em_booking_validate”) for a field. I just need One example piece of code then Ill know where to go.

    Computes code below.

    if( ! empty( $_REQUEST['company'] ) ){
    		$EM_Booking->booking_meta['registration']['company'] = wp_kses( $_REQUEST['company'], array() );
    	}

    It doesn’t help me because it doesn’t mention em_booking_add at all. If i can have a repost of that code including em_booking_add, I’m definitely sure how to apply it to em_event_save.

    All will be good. ??

    Thanks

    Please tell me if you think I should make this into a new post.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    happy to give pointers, but we can’t exactly write a long snippet for each question/situation ??

    in this case, if you don’t want to use pro fields, see our tutorials for an example of how we hook into saving event stuff with pro (https://wp-events-plugin.com/tutorials/), and then apply the snippet above in combination with using the similar filters in the file classes/em-booking.php

    e.g.

    em_booking_get_post – get the custom field, add it to the booking_meta as above
    em_booking_validate – validate the field if needed

    it saves automatically, but to retreive information you may need to hook in elsewhere.

    Hello. I’m trying to add 2 custom fields to my booking form (RPrice and RSpaces, R stands for reduced tickets). So I want my current booking form with the fields “Ticket Type”, “Price” and “Spaces” to have these other two as well. I’ve managed to add RPRice, by making several changes, but my problem is the value isn’t saved when I edit the ticket. It shows by default 0.00 Euros, unless I go to the localhost database and change the value.

    Can anyone please help me with this, I’m a newbie programmer and I’m doing my thesis, and it’s very important for me to make this work.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘[Plugin: Events Manager] Custom booking form in code’ is closed to new replies.