Event date and name in the cart

Home Forums Ticket Products Event Tickets Plus Event date and name in the cart

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1092465
    Riccardo
    Participant

    Hi,
    when I add a event, there is a date, name event.
    The ticket name maybe “vip”, “normal”… but when I add to cart I have only the ticket name and not the others info.
    Is it possibile to integrate the others information in the order too?
    thanks

    #1092651
    Riccardo
    Participant

    Hi,
    so I want to add the info (date of event, title of the event) in the PDF invoice.
    How can I do it?
    Thanks

    #1093068
    Josh
    Participant

    Hey Riccardo,

    Thanks for reaching out to us!

    You can take a look at the WooCommerce documentation for customizing their cart views as a start here. To get the information you’re looking for though, you’ll need to first get the event associated with the ticket “product” that is in the cart. For this, you can get the product ID and use that to get the “_tribe_wooticket_for_event” meta for that product. This meta is the ID for the associated event.

    From there, you can use function like  tribe_get_start_date() and get_the_title() to get the the information that you would like to display within the cart.

    Let me know if this helps.

    Thanks!

    #1093139
    Riccardo
    Participant

    Hi,
    this is the function for the cart

    add_filter( 'woocommerce_cart_item_name', 'woocommerce_cart_item_name_event_title', 10, 3 );
    
    function woocommerce_cart_item_name_event_title( $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 del giorno %s</strong></a>', $title, get_permalink( $event_id ), get_the_title( $event_id ), tribe_get_start_date( $event_id ) );
    	}
    
    	return $title;
    }
    

    can you help me for the thank you, checkout function and the pdf invoice?
    thanks

    #1094183
    Josh
    Participant

    Hey Riccardo,

    I’m not sure I follow on the PDF ticket? Are you referring to the general ticket email that gets sent when a user purchases? Or do you have another plugin that converts the emails into PDFs?

    Thanks!

    #1100444
    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 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Event date and name in the cart’ is closed to new replies.