Adding Category to Ticket in Woo – Overridding via Themer's Guide not working.

Home Forums Ticket Products Event Tickets Plus Adding Category to Ticket in Woo – Overridding via Themer's Guide not working.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1061433
    Melanie Adcock
    Participant

    I found this thread which allows me to add the category of “Ticket” to each event using Events Ticket Plus (needed a category so I can add a custom field in Woocommerce only on the ticket products with the category of “Ticket”) https://theeventscalendar.com/support/forums/topic/missing-function-in-event-tickets-plus/
    by adding this to line 510
    //add ticket category to ticket
    wp_set_object_terms( $ticket->ID, ‘Ticket’, ‘product_cat’, true );

    I added the code to the file in the plugins folder and naturally it worked. But I need to add it to the override folder inside my theme folder as directed in your Themer’s Guide.
    I tried adding to [theme-name]/tribe-events/tickets/src/Tribe/Commerce/WooCommerce/main.php but it didn’t work. I am missing something? Should the first sub folder be called something else? I tried tickets-plus but that didn’t work either.
    Thanks
    Melanie

    #1061481
    Brian
    Member

    Hi,

    Thanks for using our plugin. I can help out here.

    It is not possible to change the plugin files like that.

    That only works for files in the views directory (event-tickets-plus/src/views/), which our the front end templates.

    Instead that coding needs to be added through an action in your theme’s functions.php.

    I do not have that hook off the top of my head, but can look it up on Monday and provide a snippet to do this I believe.

    Thanks

    #1061809
    Brian
    Member

    Ok I came up with this snippet and tested it.

    It worked for me to add the Ticket Category for all new tickets created:

    https://gist.github.com/jesseeproductions/b599f873ec03f6592e01

    Add that to your theme’s functions.php and it will do the rest.

    Let me know how that works out.

    Thanks

    #1061811
    Melanie Adcock
    Participant

    Thanks Brian. I had the whole thing set up with WooTickets but since Events Ticket Plus came out I figure I would switch it before this site goes live. Save me the trouble of switching later.
    Look forward to hearing from you.
    Melanie

    #1061842
    Brian
    Member

    Looks like we posted around the same time, please check my last post for a snippet to do this.

    Thanks

    #1061897
    Melanie Adcock
    Participant

    Thanks. I’ll use it unless you know a better way for my client to collect other attendees names when someone purchases more than one ticket a time.

    Melanie

    #1062056
    Brian
    Member

    We are hoping to release a custom meta feature for the tickets plugins in one of the next major releases that enables you to collect more information per ticket.

    For now we do not have a feature to do that.

    #1078856
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Adding Category to Ticket in Woo – Overridding via Themer's Guide not working.’ is closed to new replies.