Add tickets meta to woocommerce order items

Home Forums Ticket Products Event Tickets Plus Add tickets meta to woocommerce order items

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #955520
    jerome payot
    Participant

    Hi,

    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;
    }
    #956150
    Gustavo Bordoni
    Keymaster

    Hi 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,

    #956180
    jerome payot
    Participant

    Hi,

    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 : Email Order Admin)
    but in woocommerce backoffice, i see only ticket name without event name (like this : Backoffice )

    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.

    #956181
    Gustavo Bordoni
    Keymaster

    Hi 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,

    #956182
    jerome payot
    Participant

    Hi,

    Yes i can wait.

    Here backoffice image : Backoffice

    Thanks to help me.

    #957208
    Gustavo Bordoni
    Keymaster

    Hi 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,

    #957254
    jerome payot
    Participant

    Waouh !!!!! You are really amazing ! It works. Thnak you so much to take time to do this snippet. Really great.

    Thanks again.

    #957333
    Gustavo Bordoni
    Keymaster

    That’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,

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Add tickets meta to woocommerce order items’ is closed to new replies.