Skip to content

Instantly share code, notes, and snippets.

@PaulHughes01
Last active December 11, 2015 23:39
Show Gist options
  • Select an option

  • Save PaulHughes01/4678437 to your computer and use it in GitHub Desktop.

Select an option

Save PaulHughes01/4678437 to your computer and use it in GitHub Desktop.
Workaround to pass a given currency to Eventbrite when using Modern Tribe's The Events Calendar: Eventbrite Tickets plugin.
<?php
/* PLACE THE FOLLOWING IN YOUR THEME'S FUNCTIONS.PHP FILE. */
add_action( 'tribe_eb_after_event_creation', 'my_change_tribe_eventbrite_currency', 10, 4 );
function my_change_tribe_eventbrite_currency( $eventbrite_id, $venue_id, $organizer_id, $post_id ) {
// See http://www.currencysystem.com/codes/ for a list of three-letter
// currency acronyms. Change the below variable to your preference.
$currency_acro = 'EUR';
$parameters = 'id=' . $eventbrite_id . '&currency=' . $currency_acro;
$success = Event_Tickets_PRO::sendEventBriteRequest( 'event_update', $parameters, $post_id, true, true, false );
if ( !$success ) {
add_filter( 'tribe_eb_error_message', 'my_change_tribe_eventbrite_currency_failed' );
}
}
function my_change_tribe_eventbrite_currency_failed() {
return 'Failed to update the currency.';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment