Home › Forums › Ticket Products › Event Tickets Plus › Add tickets meta to woocommerce order items
- This topic has 7 replies, 2 voices, and was last updated 11 years ago by
Gustavo Bordoni.
-
AuthorPosts
-
April 14, 2015 at 12:42 pm #955520
jerome payot
ParticipantHi,
I use your snippet for adding event data to woocommerce checkout (see next code) but i would like to do same thing in order items into back office before order. Now, i have only ticket name and no meta (date and event title) and it’s really difficult to understand for shop managers…. Do you have an idea of snippet to use ?
/** Example for adding event data to WooCommerce checkout for Events Calendar tickets. */ add_filter( 'woocommerce_cart_item_name', 'example_testing', 10, 3 ); function example_testing( $title, $values, $cart_item_key ) { $ticket_meta = get_post_meta( $values['product_id'] ); $event_id = absint( $ticket_meta['_tribe_wooticket_for_event'][0] ); if ( $event_id ) { $title = sprintf( '%s for <a href="%s" target="_blank"><strong>%s</strong></a>', $title, get_permalink( $event_id ), get_the_title( $event_id ) ); } return $title; }April 16, 2015 at 3:45 pm #956150Gustavo Bordoni
KeymasterHi Jerome,
Thanks for reaching out to us here on the forum.
Sorry for wasting your time with a delayed answer, but I didn’t fully understand what you want to accomplish.
Can you elaborate your answer a bit more, maybe with a few screenshots.
My Best Regards,
April 16, 2015 at 11:59 pm #956180jerome payot
ParticipantHi,
Sorry for my poor english…
So, i’m using snippet to show into cart ticket name and event name (show name and date). It works into cart, checkout and order emails (like this :
)
but in woocommerce backoffice, i see only ticket name without event name (like this :
)My client doesn’t know which event is sold. In fact, each event has 3 tickets (regular price, student price and senior price). Do you have an idea of snippet to fix it ?
Best regards.
April 17, 2015 at 12:29 am #956181Gustavo Bordoni
KeymasterHi Jerome,
I cannot see the “Backoffice” image, it seems like it’s broken.
I will send you a link to a plugin Snippet which accomplish both of the things you need, but It will require some time, are you ok with that?
My Best Regards,
April 17, 2015 at 12:31 am #956182jerome payot
ParticipantHi,
Yes i can wait.
Here backoffice image :

Thanks to help me.
April 21, 2015 at 7:27 pm #957208Gustavo Bordoni
KeymasterHi Jerome,
It took me a little bit more then I was expecting but I created the Add-on Snippet for you; Follow instructions on the link below and you should be good to go.
https://github.com/bordoni/tec-forum-support/tree/plugin-955520
My Best Regards,
April 22, 2015 at 12:17 am #957254jerome payot
ParticipantWaouh !!!!! You are really amazing ! It works. Thnak you so much to take time to do this snippet. Really great.
Thanks again.
April 22, 2015 at 7:04 am #957333Gustavo Bordoni
KeymasterThat’s awesome to hear Jerome, glad that this snippet solved your issue.
I will mark the correct answer on this thread and close it.
My Best Regards,
-
AuthorPosts
- The topic ‘Add tickets meta to woocommerce order items’ is closed to new replies.
