Tickets with event image and ticket description

Home Forums Calendar Products Events Calendar PRO Tickets with event image and ticket description

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1427456
    Jack
    Participant

    Hi there,

    I’ve searched a way back in the forum and can’t find an answer – apologies if it has been covered.

    I’ve created a child theme and made an email.php document, but I need some guidance on the code to put in there, if what I’m after is the default ticket template with an event image above the header, and also the ticket description underneath the name of the ticket.

    Thanks in advance,

    Jack

    #1428922
    Andras
    Keymaster

    Hello Jack,

    Thanks for using our plugins and welcome to the forums!

    Great questions! I can help you with these.

    A good starting point is our Themer’s Guide, which will explain in detail how you can create a template override, even for the email file. (You might have done this already.)

    Image: You can assign an image to the tickets and that will be included in the email as the header.

    You can set it up when you click on “Settings” in the Tickets box when editing and event / tickets. (Screenshot)

    If you want to use the featured image of the event, then you can use the get_the_post_thumbnail() function of WordPress (link). You will need to provide the event id, which you should be able to get with ‘$event->ID’ in the email.php file.

    For showing the ticket description you should be able to use get_the_excerpt from WP (link), just need to feed it the id of the ticket.

    Hope this helps you get started. Let me know.

    Cheers,
    Andras

     

    #1429198
    Jack
    Participant

    Thanks very much Andras, that’s a great help! I’ve got the header image sorted, and excuse my basic knowledge of coding…! I wonder if it would be possible to copy the lines of code I’d need to insert into the tickets in order to get the description shown on the tickets email too?

    Apologies for the hassle – while I can play about with it a little bit, I’m definitely a novice with writing code!!

    Thanks again,

    Jack

    #1430273
    Andras
    Keymaster

    Hi Jack,

    You’re welcome and no worries about being a novice. We all start like that. 🙂

    For the email you can create a template override as described in the Themer’s Guide.

    You will need to create an override for this file:

    wp-content/plugins/event-tickets/src/views/tickets/email.php

    And you need to place it here:

    wp-content/themes/[your-child-theme]/tribe-events/tickets/email.php

    Best is to copy a file there and then make the changes you want.

    You will likely be able to access the ticket description with:

    $ticket['ticket_excerpt']

    but not sure about that.

    ‘$ticket’ is an array containing a bunch of info. If you want to check all the contents of it, then first insert print_r( $ticket ) into the code and make a purchase. Then in the ticket email you should see the contents of the full array. Then you can choose the data you need.

    Let me know how far you get.

    Cheers,
    Andras

    #1431334
    Jack
    Participant

    Hi Andras,

    Thanks very much for your reply! It was very helpful, and I managed to print the array. However, the ticket description wasn’t in there, so I’ve just had to leave it out for now. If you have any further advice for me to try, let me know; if not, don’t worry!

    Have a great weekend,

    Jack

    #1432134
    Andras
    Keymaster

    If you have the ticket ID, then you can try to call get_the_excerpt() to get the description. Give this a try.

    A.

    #1451748
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Tickets with event image and ticket description’ is closed to new replies.