• Hello, I would like users to be able to submit events anonymously.

    How and where can I change the settings using placeholders so that, for example, the time zone is not selectable or the region, country, or URL fields are hidden for the address?

    I’ve spent about two hours searching for the settings and changing various things, but so far I haven’t succeeded.

    Thank you in advance.

Viewing 15 replies - 16 through 30 (of 37 total)
  • Thread Starter gudrun

    (@gudrunpetz)

    Hello, thanks for the explanation.

    Thank you for your help.

    I want ALL fields to be required.
    So do I have to add “required” to EVERY label line? Or is there an easy way to make all fields required?

    I copied the following files and pasted them into Plugins-templates/event-manager/…:

    Attributes-public.php
    Categories-public.php
    Location.php
    Event-editor.php

    Which files do I need to copy so that I can also make the date and time required, since there are several files with dates and times?

    As an anonymous user, can I also add a field with “Institution/Company” above the name and email address?

    Thread Starter gudrun

    (@gudrunpetz)

    Hello, I have a problem with the public event form.

    When editing, everything is as expected. However, the event form is displayed differently in the public area of ​​the website, and functions are not available: https://ostbayerische24.de/veranstaltungen/veranstaltung-einreichen

    • If you select the URL, the address information is still visible.
    • If you select the location, the URL information is also visible.
    • It is not possible to select the location.
    • The field for the event categories should actually be displayed below the label, but instead it is visible next to it.

    As I wrote: When I register, the form is displayed as intended.

    Thread Starter gudrun

    (@gudrunpetz)

    Hello, I’ve partially resolved the problem now.

    1. A country shouldn’t be requested when creating an event, so I selected Germany as the default country.
      I hid the country in the form field.

    Now I get the error “The country is required” when submitting. Where do I deactivate this message?

    1. Question about the category: The first selection is immediately used. I want a select field with free text for selection, like with the region. How do I do this?

    In addition, the following questions are unclear:
    Which files do I need to copy so that I can also specify the required date and time, since there are multiple files with dates and times?

    As an anonymous user, can I add an additional field with “Institution/Company” above the name and email address?

    joneiseman

    (@joneiseman)

    You don’t add “Required” to the template for fields that your want to be required. But a code snippet could be created to make additional fields required.

    First you asked about making the fields in the anonymous booking forms to be required. Now it looks like your asking for fields in the event editor to be required. There is no option to make all fields required. The date field is already a required field. The event name is also required. To require the event owner’s name and email:

    add_filter('em_event_validate', function( $valid, $EM_Event) {
    if( !empty($EM_Event->event_owner_anonymous) ) {
    if (empty($EM_Event->event_owner_email)) {
    $valid = false;
    $EM_Event->add_error( sprintf(__("%s is required.", 'events-manager'), __('Your email address','events-manager')) );
    }
    else if (empty($EM_Event->event_owner_name)) {
    $valid = false;
    }
    }
    return $valid;
    }, 10, 2 );

    joneiseman

    (@joneiseman)

    You can’t add additional fields to the booking form in the free version of the plugin.

    Thread Starter gudrun

    (@gudrunpetz)

    You can’t add additional fields to the booking form in the free version of the plugin.

    -> With the Pro version, however, can I add additional fields to my anonymous event submission form?

    joneiseman

    (@joneiseman)

    In the free version of the plugin you can add additional fields for events (including for anonymous event submissions). You can find the documentation here: https://wp-events-plugin.com/documentation/event-attributes/

    Thread Starter gudrun

    (@gudrunpetz)

    Okay, thanks. I’ve already created an attribute.

    How can I resolve the country issue and the error message?

    Thread Starter gudrun

    (@gudrunpetz)

    Hello, I’m using the anonymous booking form.

    This should allow users to specify, for example, whether they want to pay for admission: _ATT{Admission}{Please select|Admission is free|Admission is subject to a fee}

    The note “Please select” should be visible in the field, but not selectable. How do I do this in Event Manager?

    I think you mean the event edit form. The booking form does not show any Event Attributes. To make this “Admission” field to have one of the values other than “Please select” you can use the event validatation to require a selection:

    add_filter('em_event_validate', function( $valid, $EM_Event) {
    if( !empty($EM_Event->event_owner_anonymous) ) {
    if (array_key_exists('Admission', $EM_Event->event_attributes) && EM_Event_attributes['Admission'] == "Please select") {
    $valid = false;
    $EM_Event->add_error( sprintf(__("%s must be selected.", 'events-manager'), __('An Admission type','events-manager')) );
    }
    }
    return $valid;
    }, 10, 2 );
    Thread Starter gudrun

    (@gudrunpetz)

    Hello, one more question:
    How can I limit the number of past events for locations to 10?

    Thread Starter gudrun

    (@gudrunpetz)

    Hello and thank you for the reply. I’ve added the add_filter.

    Unfortunately, the required fields don’t work.

    I can submit the form without having to enter any information in these fields.

    • Time,
    • Venue name,
    • Address
    • Region and admission
    • The event description.
    • The confirmation field for the submitted data.

    Why isn’t the required field being accepted?

    Because I haven’t provide a code snippet to make all those things required.

    Thread Starter gudrun

    (@gudrunpetz)

    Hello, I added this Add_filter to snippets. However, it doesn’t work and a critical error is displayed.

    What’s the problem? _ATT{Admission}{Please select|Admission is free|Admission is subject to a fee}

    add_filter(’em_event_validate’, function( $valid, $EM_Event) {
    if( !empty($EM_Event->event_owner_anonymous) ) {
    if (array_key_exists(‘Admission’, $EM_Event->event_attributes) && EM_Event_attributes[‘Admission’] == “Please select”) {
    $valid = false;
    $EM_Event->add_error( sprintf((“%s must be selected.”, ‘events-manager’), (‘An Admission type’,’events-manager’)) );
    }
    }
    return $valid;
    }, 10, 2 );

    Thread Starter gudrun

    (@gudrunpetz)

    Oh, but then the form will only be partially filled out, leaving a lot of unanswered questions, right?

    Should I then manually set the required field via HTML because I’m not familiar with PHP?

Viewing 15 replies - 16 through 30 (of 37 total)
  • You must be logged in to reply to this topic.