Home › Forums › Ticket Products › Event Tickets Plus › Add additional data field to ticket
- This topic has 9 replies, 2 voices, and was last updated 9 years, 3 months ago by Brian.
-
AuthorPosts
-
January 5, 2015 at 1:27 pm #928974MarcParticipant
Hello,
I’m looking to add an additional field (i.e. attach custom data) to a ticket. This does not necessarily need to be done in WooCommerce, it is required mostly to update UI within Tickets views.
For example, within the add ticket metabox, it would be ideal to add a checkbox (e.g. underneath Stock and SKU) of which the value could be queried per Ticket within the views, e.g. the product page or cart.
Is this possible at all?
January 5, 2015 at 2:36 pm #929024BrianKeymasterHi,
Thanks for using out plugins.
I can answer your question. It is possible to modify the ticket template there are no options in the admin to change the content.
If you follow our themer’s guide:
https://theeventscalendar.com/knowledgebase/themers-guide/
You could then move and modify this template:
\the-events-calendar\views\tickets\email.php
That is the only method we have for doing this. Anything else would involve a large customization that we cannot provide support on.
Let me know if you have any follow up questions.
Thanks
January 5, 2015 at 2:44 pm #929028MarcParticipantThanks for the reply Brian. Not quite what I was after though, I’m afraid.
Let me rephrase with a more specific scenario.
An event may have multiple tickets, let’s say one is “Member” and another is “Unregistered”. The checkbox I described would be used to determine whether to hide the “Member” ticket for users who aren’t signed in (e.g. on the event page).
Again I’m simplifying, so it does not matter in this case that WooCommerce wouldn’t honour this value.
Essentially I’m asking whether it’s possible to add post meta to Tickets, which I can pick up in templates. Feel free to be as technical as you need to describe.
Thanks again!
January 6, 2015 at 7:58 am #929316BrianKeymasterOk I get what you are trying to do.
I can point you in the right direction, but there is not much more I have for you on a customization like this.
Following the themer’s guide above you could move this file:
\wootickets\views\wootickets\tickets.php
To your theme to edit as that is what shows the tickets in each single event. You maybe to modify it there change it show tickets to different people. The easiest way maybe to use a category instead of trying to add a meta box somewhere.
I know that is not much, but I am afraid there is not much else we have on this, if you think that is something you would like as a feature I encourage you to visit our User Voice Page and either upvote an existing request or make a new request there.
Thanks
January 6, 2015 at 1:16 pm #929506MarcParticipantAh I see, that’s getting somewhere. So it’s possible to add a category to a ticket with Wootickets?
Or must I manually follow the edit link through to WooCommerce and add it to the post there?
January 6, 2015 at 4:24 pm #929584BrianKeymasterIt is not possible to add a category through WooCommerce Tickets.
You would have to do that from the Product Edit Page.
January 7, 2015 at 11:18 am #930029MarcParticipantOkay, I see. Do you have any hooks to pull that through from WooCommerce?
January 7, 2015 at 3:57 pm #930149BrianKeymasterWe do have an action to add more metaboxes it is called:
tribe_events_tickets_metabox_advanced
And found on line 249 of 3.9 of the Events Calendar in this file:
the-events-calendar\lib\tickets\tribe-tickets.php
You maybe to add a field using that.
However, there is no way to hook into our save function that uses ajax so you would have to come up with your own method to save that field or modify the plugin.
The save function is found in this file around line 320:
\wootickets\classes\class-wootickets.php
There is not much more I can help on this customization so you maybe on your own from here.
Thanks
January 8, 2015 at 2:20 am #930308MarcParticipantBrilliant, works for me.
Thanks again
January 8, 2015 at 5:03 am #930358BrianKeymasterGreat, glad it helps, I am going to go ahead and close this ticket as there is not much more we can on for customizations and you marked the answer correct on my previous post.
If you need help on this (we are limited, but can try to help) or something else please post a new ticket.
Thanks!
-
AuthorPosts
- The topic ‘Add additional data field to ticket’ is closed to new replies.