Help Desk

Sell Tickets Through Eventbrite While Not Publicizing Event on Eventbrite

  • Posts: 9 Topics: 2
    | Permalink

    We want to sell tickets via Eventbrite but not publicize our events through Eventbrite (i.e., we only want to publicize them on our website). I found a January 2017 forum post–https://theeventscalendar.com/support/forums/topic/why-does-plugin-not-work-for-private-events-yet-iframe-widget-does/–that addresses the issue and provides a way to do this. Is the information in that post still current?

    Thanks.

    Posts: 6123 Topics: 2
    | Permalink

    Hello duekerla,

    Thanks for reaching out.

    There haven’t been any major changes to our Eventbrite plugin, so that should still work. Give it a try and let me know if you need further assistance.

    Cheers,
    Andras

    Posts: 9 Topics: 2
    | Permalink

    Hi András,

    Yup, it still works.

    One issue with the code that’s displayed in that post, however. Not quite sure how this happened, but a number of characters have been turned into their HTML code equivalents. That would be fine if this were HTML, but it’s not–it’s pure PHP. For example, the code as written reads (line 5):

    $event = $api->get_event( $post_id );

    It should read:

    $event = $api->get_event( $post_id );

    Similar problems exist throughout the code, bringing down the website with syntax errors. Once I translated all the HTML codes to the characters they represented, things worked fine. Here’s the result, in case it’s useful to someone else in the future:

    /* RENDER IFRAME EVEN WHEN EVENTBRITE EVENT IS SET TO PRIVATE */
    function eb_iframe_show_even_if_private() {
        $post_id  = get_the_ID();
        $api = tribe( 'eventbrite.api' );
        $event = $api->get_event( $post_id );
    
        if ( ! $event ) {
            return;
        }
    
        $event_id = $event->id;
    
        $iframe_url = ( is_ssl() ? 'https://' : 'http://' ) . 'www.eventbrite.com/tickets-external?eid=%s&ref=etckt&v=2';
        $iframe_url = apply_filters( 'tribe_events_eb_iframe_url', sprintf( $iframe_url, $event_id ) );
    
        $html = '';
    
        if (
            ! empty( $event_id ) &&
            $api->is_live( $post_id ) &&
            tribe_event_show_tickets( $post_id )
        ) {
            $html = sprintf(
                '<div class="eventbrite-ticket-embed" style="width:100%%;text-align:left">
                            <iframe id="eventbrite-tickets-%1$s" src="%2$s" style="height:200px;width:100%%;overflow:auto;"></iframe>
                            <div style="font-family:Helvetica, Arial;font-size:10px;padding:5px 0 5px;margin:2px;width:100%%;text-align:left">
                                <a target="_blank" href="http://www.eventbrite.com/features?ref=etckt">Event registration</a>
                                <span style="color:#ddd"> powered by </span>
                                <a target="_blank" href="http://www.eventbrite.com?ref=etckt">Eventbrite</a>
                            </div>
                        </div>', $event_id, $iframe_url );
        }
    
        $html = apply_filters( 'tribe_template_factory_debug', $html, 'Tribe__Events__Eventbrite__Template::the_tickets' );
        return apply_filters( 'tribe_events_eb_iframe_html', $html, $event_id, $post_id );
    }
    
    add_filter( 'tribe_events_eventbrite_the_tickets', 'eb_iframe_show_even_if_private' );

    Bob (website support for duekerla)

    Posts: 6123 Topics: 2
    | Permalink
    Correct Answer

    Hi Bob,

    Thanks for reporting back and for sharing your solutions! Much appreciated! Great to hear it works!

    Since this is marked resolved I am going to close this ticket, but if you need anything else related to this topic or another please create a new ticket and we’ll be happy to help.

    Cheers,
    Andras

    PS: If you like our plugins, and you didn’t yet do so 🙂 we would be happy to receive a review in the wordpress.org repository. Thanks!
    https://wordpress.org/support/view/plugin-reviews/the-events-calendar/
    https://wordpress.org/support/view/plugin-reviews/event-tickets/

    PS2: We’d be also grateful if you would give us feedback on your satisfaction with support. Just click on one of the classy looking emojis below. 🙂 If you can spare a few words, that’s even better. Doublethanks!

     

    | Permalink

The topic ‘Sell Tickets Through Eventbrite While Not Publicizing Event on Eventbrite’ is closed to new replies.