Add description to HTML ticket

Home Forums Ticket Products Event Tickets Plus Add description to HTML ticket

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #57756
    inspyrmedia
    Participant

    I’m setting up WooTickets for a website that offers events that have multiple meetings on different locations. So basically you purchase one ticket for the area ‘Amsterdam’ that allows access to (for example) 6 meetings on different locations through Amsterdam on different days.
    Because of this we would like to add a textfield (for example the description) to the HTML ticket. This would make it possible to include the event roster on the ticket.

    Is this possible (through customisation)? If so: can someone point me in the correct direction?

    #57846
    Barry
    Member

    You should be able to do this by overriding the tickets/email.php template and adding your customization in there (please see our themer’s guide for an overview of the template override process) … does that help?

    #57932
    inspyrmedia
    Participant

    Hi Barry,
    Thanks for your reply. I’ve been digging through the themer’s guide and other documentation but I’m still struggling. First off: I’m running The Events Calendar 3.0.2 and WooTicket 3.0.1. and I have a copy of my tickets.php in the /twentytwelve/tribe-events/wootickets/ because of the bug in the current release.

    What I’m trying to accomplish is this:
    1. Add individual ticket description to the email file.
    2. Finally: create a custom field for each ticket called ‘event roster’ that I can print instead of the description so I can use the description on the event page and the roster on the actual ticket.

    What I’ve tried:
    1. Create a new email.php in /twentytwelve/tribe-events/tickets/ and add some custom text to verify that the file is being used – Working.
    2. Analyse tickets.php for information about the ticket description. Found: echo $ticket->description;
    3. Try adding this to the custom email.php as description; ?> or

    Neither works and I haven’t been able to find any documentation concerning echo $ticket->description;

    Can you please advise how to proceed? Any advise on working with that custom field per ticket (event roster) would be great to. If it’s easier to create the event roster textfield immediately and skip the ticket description, I’m fine with that to.

    Finally are the ‘Events Calendar Pro’ CUSTOM EVENT ATTRIBUTES required for this?

    #57933
    inspyrmedia
    Participant

    It seems that my php echo’s are being stripped from the forum…
    With spaces:
    description ; ? >
    or

    #57947
    Barry
    Member

    Hi inspyrmedia – you’re hitting up against a problem with our current forum software. I know it’s a bit of a pain, but can I ask you to share your code using Gist, Pastebin or a similar service (and just drop the link in here)?

    Based on what hasn’t been stripped it’s sounding like you are close to a solution here.

    #58019
    inspyrmedia
    Participant

    Hi Barry,

    It’s nothing more than finding the code in the tickets.php file and as mentioned it doesn’t work, nor is it the solution I’m looking for. Please have another look at my second post concerning the custom field.

    The code I found in tickets.php: http://pastebin.com/1Ph1NGE9

    #58029
    Barry
    Member

    OK, well to create an additional field to contain a roster you might use Event Calendar PRO’s additional fields feature (if you have that plugin).

    Whether you do use Events Calendar PRO for this or build your own solution the process of taking this and injecting it into the email is really a matter of custom development work – so we can try and push you in the right direction but we can’t build it for you.

    I’m not absolutely clear at this point if you still need help adding the ticket (product) description to the emailed tickets, or pulling in a custom field, or both of those.

    #58223
    inspyrmedia
    Participant

    Hi Barry,

    Currently I have only found a call (the one on pastebin) that seems to be used for displaying the ticket description on the event page, but doesn’t work on the email ticket. So I need help with both. To clarify: I need either a custom field per ticket (NOT per event) that can be printed on the ticket AND/OR I need the ticket description to be printed on the ticket.

    Let me clear this up in four followup questions. If you could answer them one at a time, that would be great.

    1. Can the Event Calendar PRO’s additional fields feature be used (out of the box) on ticket basis or only on event basis?
    2. Is the Event Calendar PRO’s additional fields feature, in your opinion, the best way to add additional text fields to tickets?
    3. Can the Event Calendar PRO’s additional fields be easily added to the emailed ticket?
    4. Can someone provide me with the PHP call to display the ticket description on other pages or the ticket email? The call is NOT documented in your developer documentation nor is the code I found in tickets.php working: http://pastebin.com/1Ph1NGE9 – This seems like something that a plugin developer should know off the top of his head.

    #58243
    Barry
    Member

    Thanks for clarifying 🙂

    1. Can the Event Calendar PRO’s additional fields feature be used (out of the box) on ticket basis or only on event basis?

    Per event only. Remember though that each ticket is in fact a regular WooCommerce product and can be edited as such – so you could potentially assign custom fields that way.

    2. Is the Event Calendar PRO’s additional fields feature, in your opinion, the best way to add additional text fields to tickets?

    If you need it to contain per-ticket information rather than per-event then no, but if you did then it would simply offer a convenient way to store and edit extra information that you wish to include per event.

    3. Can the Event Calendar PRO’s additional fields be easily added to the emailed ticket?

    Relatively easily, yes, but it does require some knowledge of developing in a WordPress landscape.

    4. Can someone provide me with the PHP call to display the ticket description on other pages or the ticket email? The call is NOT documented in your developer documentation nor is the code I found in tickets.php working: http://pastebin.com/1Ph1NGE9 – This seems like something that a plugin developer should know off the top of his head.

    Importantly, it’s not a “call” and stripping code from one template and dropping it into another – where the same context may not exist – is not guaranteed to be a successful approach.

    If you look in the tickets/email.php template you can see a loop near the top (beginning foreach ($tickets as $ticket) … and within that block $ticket will exist as an array – so something quite different from its usage in the code you copied from tickets.php (where it existed as an object).

    In this context though that array does however contain useful information such as the ID of the event itself – and from there you could obtain the actual ticket product and display the ticket description (actually stored as the excerpt). Taking this further, that basically means that the actual product description is empty so that could be another field that you leverage here.

    Hope that gets you on track 🙂

    #62426
    Barry
    Member

    Closing this one out.

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Add description to HTML ticket’ is closed to new replies.