Remove cost from event imported from Eventbrite

Home Forums Ticket Products Eventbrite Tickets Remove cost from event imported from Eventbrite

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1038275
    Bennie
    Participant

    Hi, how do I remove the price range, immediately below the event description and dates, when I import an event from Eventbrite?

    The cost field (which I’ve made visible by adding “add_filter( ‘tribe_events_admin_show_cost_field’, ‘__return_true’, 100 );” to my functions,php file, seem to have ZERO effect here; ideally I’d like the cost field to override the cost coming in from EventBrite, at least at the top display (I appreciate it can’t/won’t override the tickets).

    Even if you ignore the cost field, I’d still like no cost to display at the top – how to effect that?

    Thanks
    Bennie Naude

    Welcome to DeepLiving

    #1038527
    Nico
    Member

    Hey Bennie,

    Thanks for reaching out to us! Hopefully what you are looking for is achievable by a simple code snippet ๐Ÿ™‚

    Just add the following code to your theme functions.php file located at wp-content/themes/your_active_theme/:


    function use_cost_field( $cost, $post_id ) {
    return esc_html( get_post_meta( $post_id, '_EventCost', true ) );
    }

    add_filter( 'tribe_get_cost', 'use_cost_field', 100, 2 );

    You should now see the cost field value instead of the tickets price range, please let me know if this works for you.

    Best,
    Nico

    #1038863
    Bennie
    Participant

    Thanks Nico

    Now the currency symbols have disappeared from all my events – how do I get that back?

    http://www.deepliving.com/events

    Thanks
    Bennie

    #1038963
    Nico
    Member

    Hey Bennie,

    Try this updated version of the snippet:


    function use_cost_field( $cost, $post_id ) {

    $currency = tribe_get_event_meta( $post_id, '_EventCurrencySymbol', true );
    $new_cost = get_post_meta( $post_id, '_EventCost', true );

    if ( $new_cost > 0 ) {
    $new_cost = $currency . ' ' . $new_cost;
    } else {
    $new_cost = $cost;
    }

    return esc_html( $new_cost );
    }

    add_filter( 'tribe_get_cost', 'use_cost_field', 100, 2 );

    It will grab the currency symbol you define per event.

    Please let me know about it,
    Best,
    Nico

    #1039072
    Bennie
    Participant

    Thanks Nico, that did it.

    Best wishes
    Bennie

    #1039372
    Nico
    Member

    Glad to hear Bennie ๐Ÿ™‚

    Iโ€™ll go ahead and close out this thread, but if you need help with anything else please donโ€™t hesitate to create a new one and we will be happy to assist you.

    Best,
    Nico

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Remove cost from event imported from Eventbrite’ is closed to new replies.