Okay
  Public Ticket #2202363
RSVP options in a CSV upload
Closed

Comments

  • rtackabury started the conversation

    I am uploading events through CSV. However, there does not appear to be any option in the CSV settings to do anything related to RSVP. Specifically, it would be helpful to do these things:

    •  Toggle RSVP to Event to enable
    • Set an Attendees limit
    • Toggle Attendees front-end visibility to Private

    Is there a way to make this possible?

  •  877
    Zhivko replied

    Hi,

    We'll add these options in the next update.

    Meanwhile you could use the stec_before_import_event filter.

    Place it in your theme functions.php file at the bottom:

    add_filter('stec_before_import_event', function($data) {
        $csv        = $data['csv_event']; // the csv data
        $event_post = $data['event_post']; // the event post     if (false === $event_post instanceof \Stachethemes\Stec\Event_Post) {
            return $data;
        }
        
        $event_post->set_rsvp(1); // enables rsvp
        $event_post->set_rsvp_limit(30); // sets rsvp limit to 30
        $event_post->set_attendance_visibility('private'); // sets visibility to private     $data['event_post'] = $event_post;     return $data;
    });

    Stachethemes Developer