Home › Forums › Ticket Products › Event Tickets Plus › Adding Category to Ticket in Woo – Overridding via Themer's Guide not working.
- This topic has 7 replies, 3 voices, and was last updated 10 years, 2 months ago by
Support Droid.
-
AuthorPosts
-
January 24, 2016 at 4:43 pm #1061433
Melanie Adcock
ParticipantI 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
MelanieJanuary 24, 2016 at 6:58 pm #1061481Brian
MemberHi,
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
January 25, 2016 at 7:40 am #1061809Brian
MemberOk 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
January 25, 2016 at 7:41 am #1061811Melanie Adcock
ParticipantThanks 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.
MelanieJanuary 25, 2016 at 8:12 am #1061842Brian
MemberLooks like we posted around the same time, please check my last post for a snippet to do this.
Thanks
January 25, 2016 at 8:57 am #1061897Melanie Adcock
ParticipantThanks. 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
January 25, 2016 at 11:59 am #1062056Brian
MemberWe 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.
February 20, 2016 at 8:35 am #1078856Support Droid
KeymasterThis 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. -
AuthorPosts
- The topic ‘Adding Category to Ticket in Woo – Overridding via Themer's Guide not working.’ is closed to new replies.
