Organiser phone number in ticket

Home Forums Ticket Products Event Tickets Plus Organiser phone number in ticket

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1612759
    willcurrie
    Participant

    How can I show the event organiser phone number in the ticket?

    #1613127
    willcurrie
    Participant

    I should add I’m using tribe commerce with Event Tickets Plus, I am using tickets.php in my child theme to add some additional static text to the ticket but I don’t know how to pull in the organiser phone number dynamically.

    #1614353
    Sky
    Keymaster

    Hi there,

    Thanks for reaching out. I will try to help with your question.

    There is a function specifically for getting the organizer phone number.

    $phone = tribe_get_organizer_phone( $event_id );

    You just need to pass the post_id of the event into the function.

    Check out this file to see all the other organizer related functions that are available: the-events-calendar/src/functions/template-tags/organizer.php.

    If you are working in tickets.php, the post_id will refer to the ticket itself. You will need to get the event id from the ticket id by using a function like tribe_tickets_get_event_ids(). Note that it returns an array and not a value.

    Hope that helps! Please let me know if you have any additional questions about this.

    Thanks,
    Sky

    #1614377
    willcurrie
    Participant

    Hi Sky

    Thanks for the response, my level of skill would require you to give me a much more detailed answer. Can you do that please?

    #1615166
    Sky
    Keymaster

    Hi again,

    Please note that we are limited in the amount of support we can provide for customizations. That being said, I will try to help as much as I can with this.

    Can you provide a screenshot showing exactly where you would like the Organizer phone number to display?

    Thanks,
    Sky

    #1615917
    willcurrie
    Participant

    Thank you Sky, please see the attached.

    #1616178
    Sky
    Keymaster

    Hi again,

    The image you have provided is of the email contents. This is a completely different template than the tickets.php files, which display the tickets on the event page.

    To modify the ticket email, you will want to copy event-tickets/src/views/tickets/email.php into [your-theme]/tribe-events/tickets/email.php and make your modifications.

    In this template, it loops through the organizers for the ticket starting at line 463. You would want to add your changes inside this loop. This should get you started.


    <?php echo tribe_get_organizer_phone($organizer_id); ?>

    Hope that helps!

    Thanks,
    Sky

    #1617025
    willcurrie
    Participant

    My mistake Sky, I have done this and it works perfectly. Thank you.

    #1617639
    Sky
    Keymaster

    Hi again,

    Awesome! Glad I could help.

    Please let us know if you have any questions or issues in the future.

    Thanks,
    Sky

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Organiser phone number in ticket’ is closed to new replies.