Add additional data field to ticket

Home Forums Ticket Products Event Tickets Plus Add additional data field to ticket

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #928974
    Marc
    Participant

    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?

    #929024
    Brian
    Keymaster

    Hi,

    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

    #929028
    Marc
    Participant

    Thanks 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!

    #929316
    Brian
    Keymaster

    Ok 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.

    http://tribe.uservoice.com/

    Thanks

    #929506
    Marc
    Participant

    Ah 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?

    #929584
    Brian
    Keymaster

    It is not possible to add a category through WooCommerce Tickets.

    You would have to do that from the Product Edit Page.

    #930029
    Marc
    Participant

    Okay, I see. Do you have any hooks to pull that through from WooCommerce?

    #930149
    Brian
    Keymaster

    We 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

    #930308
    Marc
    Participant

    Brilliant, works for me.

    Thanks again

    #930358
    Brian
    Keymaster

    Great, 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!

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