Home › Forums › Ticket Products › Event Tickets Plus › Have the Additional Fields appear on invoice?
- This topic has 11 replies, 5 voices, and was last updated 9 years, 10 months ago by
Michael Jones.
-
AuthorPosts
-
April 19, 2016 at 9:24 am #1104326
Michael Jones
ParticipantReading 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.
April 20, 2016 at 8:46 am #1104874Barry
MemberHi 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?
April 22, 2016 at 12:30 pm #1106100Dan Feeley
ParticipantGlad I stumbled across this thread. That WooCommerce action is exactly what I was looking for. It works perfectly, thanks Barry.
April 22, 2016 at 1:55 pm #1106117Barry
MemberGlad to hear it helped!
April 23, 2016 at 8:16 am #1106273Michael Jones
ParticipantBarry: 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?
April 24, 2016 at 8:24 am #1106415Dan Feeley
ParticipantI 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).
April 24, 2016 at 8:28 am #1106417Michael Jones
ParticipantThank 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.
April 25, 2016 at 4:26 am #1106533Dan Feeley
ParticipantHere you go: https://gist.github.com/PthPndr/943bd38925ccc0e55b5a4f97835ad821
There are three functions.
- The first function adds the questions and answers to the order details at the time of purchase.
- The second function displays the meta on the order details page (optional)
- 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.
April 25, 2016 at 6:33 am #1106587Barry
MemberThank you for sharing, @danfeeley – nicely done 🙂
David does that allow you to get started on your own implementation?
May 2, 2016 at 9:18 am #1109569Sean Sullivan
ParticipantHey @danfeeley, I’ve been looking for something like this. Thank you!
May 2, 2016 at 2:58 pm #1109768Barry
MemberGreat 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!
-
AuthorPosts
- The topic ‘Have the Additional Fields appear on invoice?’ is closed to new replies.
