Have the Additional Fields appear on invoice?

Home Forums Ticket Products Event Tickets Plus Have the Additional Fields appear on invoice?

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1104326
    Michael Jones
    Participant

    Reading the knowledge base article on additional fields, attendance and reports, I’ve noticed through testing that the additional fields collected do not show up or are carried over to the invoice. Is there any way possible to get that information to carry over to invoice/sales email? The reason is those who take care of event books will receive an email with the sales order from the ticket when it is purchased. However if 5 people attend, they’d like to know who the 5 are to have their names added to the list at the door.

    I’ve added the extra fields, and it shows up in my attendees listing. But is there a way to have that information added to the emails that are generated from the sale? I’m using WooCommerce.

    #1104874
    Barry
    Member

    Hi David,

    Interesting idea!

    First and foremost, please do feel free to add this as a feature request – I can certainly see the utility of it and that will let others add their support, too.

    To do this now would involve some custom development work and in outline the solution might look like this:

    • Listen for the woocommerce_order_item_meta_end action firing
    • This happens for both the receipt sent to customers as well as the ‘admin’ notification
    • In the first case (customer copy) you can grab the meta fields from stored cookie data
    • In the second case (staff/admin copy) you will need to query for the tickets linked to the order and work back from there

    As you are probably already realizing, it’s a relatively advanced customization and so not one we can unfortunately go in to too much depth with here on the forum.

    Some other notes if you do wish to explore this on your own as a custom dev task:

    • Tribe__Tickets_Plus__Main::instance()->meta() provides you with access to the ‘meta manager’ object
    • That object has both get_meta_fields_by_ticket() and get_meta_cookie_data() methods you can work with
    • The relationship between ticket objects and order objects is maintained via the _tribe_wooticket_order meta field which is stored against the ticket object

    I hope that helps – and perhaps in the meantime you could allow staff to access the attendee screens in question?

    #1106100
    Dan Feeley
    Participant

    Glad I stumbled across this thread. That WooCommerce action is exactly what I was looking for. It works perfectly, thanks Barry.

    #1106117
    Barry
    Member

    Glad to hear it helped!

    #1106273
    Michael Jones
    Participant

    Barry: Thanks for the information. I’m not a coding person so not sure where to begin with customizing. I appreciate the help!

    Dan: Did you get it to work? or did you put in a feature request?

    #1106415
    Dan Feeley
    Participant

    @David,

    I got it to work. I was already displaying the additional fields on the WooCommerce order details so using the WooCommerce action that Barry mentioned allowed me to display the fields on the order invoice and emails.

    I would be happy to share my code with you if you want it. However (two things), Since technically the questions can be changed during the sale of an event for any reason, I am storing the questions and answers at the time of purchase in the database with the order. Then I use the above action to display the data in the invoice.

    Secondly, I also am not a developer so my code may not be perfect. Below is an example of what it looks like (don’t mind the gibberish, I was testing multiple purchases and special characters).

    #1106417
    Michael Jones
    Participant

    Thank you so much for the update! Could you share it with Barry and maybe he could then show me the best way to do it? Remember also that when the next update comes out, it may not have that in it….so save your coding changes. You’re more of a coder than I, my friend.

    #1106533
    Dan Feeley
    Participant

    Here you go: https://gist.github.com/PthPndr/943bd38925ccc0e55b5a4f97835ad821

    There are three functions.

    1. The first function adds the questions and answers to the order details at the time of purchase.
    2. The second function displays the meta on the order details page (optional)
    3. The third function displays the meta on the order invoice page and emails.

    All you need to do is add them to your functions.php file.

    And @Barry, I know you can’t support this but if you happen to notice anything blatantly wrong please let me know.

    #1106587
    Barry
    Member

    Thank you for sharing, @danfeeley – nicely done 🙂

    David does that allow you to get started on your own implementation?

    #1109569
    Sean Sullivan
    Participant

    Hey @danfeeley, I’ve been looking for something like this. Thank you!

    #1109768
    Barry
    Member

    Great to see this is helping others in the community 🙂

    At this point it seems like everyone is good so I’ll go ahead and close this topic. Of course, if any other issues or questions arise please do feel free to post new topics as needed.

    Thanks again!

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Have the Additional Fields appear on invoice?’ is closed to new replies.