Home › Forums › Ticket Products › Eventbrite Tickets › Remove cost from event imported from Eventbrite
- This topic has 5 replies, 2 voices, and was last updated 8 years, 4 months ago by Nico.
-
AuthorPosts
-
December 9, 2015 at 6:44 am #1038275BennieParticipant
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 NaudeDecember 9, 2015 at 4:02 pm #1038527NicoMemberHey 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,
NicoDecember 10, 2015 at 7:26 am #1038863BennieParticipantThanks Nico
Now the currency symbols have disappeared from all my events – how do I get that back?
http://www.deepliving.com/events
Thanks
BennieDecember 10, 2015 at 9:19 am #1038963NicoMemberHey 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,
NicoDecember 10, 2015 at 12:11 pm #1039072BennieParticipantThanks Nico, that did it.
Best wishes
BennieDecember 11, 2015 at 4:17 am #1039372NicoMemberGlad 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 -
AuthorPosts
- The topic ‘Remove cost from event imported from Eventbrite’ is closed to new replies.