Home › Forums › Ticket Products › Event Tickets Plus › Organiser phone number in ticket
- This topic has 8 replies, 2 voices, and was last updated 7 years, 7 months ago by
willcurrie.
-
AuthorPosts
-
September 4, 2018 at 1:10 am #1612759
willcurrie
ParticipantHow can I show the event organiser phone number in the ticket?
September 4, 2018 at 9:15 am #1613127willcurrie
ParticipantI 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.
September 5, 2018 at 10:08 am #1614353Sky
KeymasterHi 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,
SkySeptember 5, 2018 at 10:22 am #1614377willcurrie
ParticipantHi 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?
September 6, 2018 at 7:51 am #1615166Sky
KeymasterHi 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,
SkySeptember 6, 2018 at 11:40 pm #1615917willcurrie
ParticipantThank you Sky, please see the attached.
September 7, 2018 at 7:32 am #1616178Sky
KeymasterHi 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,
SkySeptember 9, 2018 at 12:55 am #1617025willcurrie
ParticipantMy mistake Sky, I have done this and it works perfectly. Thank you.
September 10, 2018 at 8:53 am #1617639Sky
KeymasterHi again,
Awesome! Glad I could help.
Please let us know if you have any questions or issues in the future.
Thanks,
Sky -
AuthorPosts
- The topic ‘Organiser phone number in ticket’ is closed to new replies.
