Display Event data (event title) into email order

Home Forums Ticket Products Event Tickets Plus Display Event data (event title) into email order

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

    Hi,

    I would like to insert event title into email order. Into cart, code is Ok with snippet (http://theeventscalendar.com/support/forums/topic/event-title-and-date-in-cart/) but i can’t show it into email order and back office display order….

    I try this :

    /**
     * Adding event data to WooCommerce Cart / Emails order for Events Calendar tickets.
     * 
     */
    add_filter( 'woocommerce_order_item_name', 'gecko_woocommerce_order_item_name', 10, 2 );
    
    function gecko_woocommerce_order_item_name( $name, $item ){
    
    	//$ticket_meta = get_post_meta( $values['product_id'] );
    	$ticket_meta =  $items[1]['item_meta']['_product_id'][0];
    	$event_id = absint( $ticket_meta['_tribe_wooticket_for_event'][0] );
    
       return $name . 'Spectacle : ' . $event_id ; 
    	
    }

    Do you have an idea ?

    #947091
    Brook
    Participant

    Howdy Jerome,

    I once wrote a very similar snippet to that: http://pastebin.com/J0XzSxTz

    These snippets are very tricky to write, because it is not very snippetable. Ultimately a much better solution is to write a custom template for WooCommerce, since all of those emails are generated by WooCommerce. Woo makes this pretty easy, even in the Woo > Settings > Email panels they list all of the emails they send, and show you where to find the template files for each. From there you can override it with extra data like in the snippet.

    I realize that this is just an overview of what to do. Unfortunately this customization is going to be a bit involved, and require a fair bit of code that will need to be written.

    Does that answer your question? Do you have any followups? Please let me know.

    Cheers!

    – Brook

     

    #947146
    jerome payot
    Participant

    Yes !!! Thanks Brook. This snippet is Ok, i just change to get event title and it works !

    #947533
    Brook
    Participant

    Oh nice! I must have completely misunderstood what you wanted to do, other wise I would have told you what to change. I am glad you knew what to change though and my snippet helped. Cheers!

    – Brook

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Display Event data (event title) into email order’ is closed to new replies.