Change default currency

Home Forums Ticket Products Eventbrite Tickets Change default currency

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #932506
    prydonian
    Participant

    How do I change the default currency from USD to GBP when creating a new ticket?

    I tried adding https://gist.github.com/PaulHughes01/4678437 to the functions file, but I get a blank screen on Publish and no ticket is created.

    #932507
    prydonian
    Participant

    I tried https://gist.github.com/PaulHughes01/4678437 but it ends up with a blank screen on publish and no ticket is generated

    #932513
    prydonian
    Participant

    How odd, it doesn’t seem to like me posting a link to the gist I used.

    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 ) {
    $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.’;
    }

    #932644
    Brian
    Keymaster

    Hi,

    Sorry for the issues you are having.

    I can help out on this.

    We have the same snippet in our knowledge base:

    https://theeventscalendar.com/knowledgebase/change-the-currency-for-eventbrite-tickets/

    I have tested that snippet within the last month without issue.

    A blank screen sounds like an error is happening. Are you able to setup debug and see what is shows?

    Debug
    Can you please follow the section of the WordPress Codex Debug titled “Example wp-config.php for Debugging” on this page:

    http://codex.wordpress.org/Debugging_in_WordPress

    Please add that coding to your wp-config.php file.

    After that please try to create an event in Eventbrite a couple times and then look in the debug file for errors.

    Please send in your next reply the information in the debug.log in the wp-content directory.

    You can make that a private replies and we can go from there.

    Thanks

    #932763
    prydonian
    Participant

    This reply is private.

    #932886
    Brian
    Keymaster

    Ok thanks for the information.

    After seeing your debug log I retested the snippet again it appears a change in 3.8 is causing the issue.

    We changed the way methods were called to the correct non-static way and that causes the issue.

    Changing this line:

    $success = Event_Tickets_PRO::sendEventBriteRequest( ‘event_update’, $parameters, $post_id, true, true, false );</code

    to this:

    $success = Event_Tickets_PRO::instance()->sendEventBriteRequest( 'event_update', $parameters, $post_id, true, true, false );

    Fixed the issue for me.

    Does that work for you?

    Thanks

    #932890
    prydonian
    Participant

    Fantastic, worked like a charm.

    Many thanks.

    #932905
    Brian
    Keymaster

    Great, glad it helps, I am going to go ahead and close this ticket and update our knowledge base with the fix, but if you need help on this or something else please post a new ticket.

    Thanks!

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Change default currency’ is closed to new replies.