Ticket Description in

Home Forums Ticket Products Event Tickets Plus Ticket Description in

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1038895
    Iain
    Participant

    Hi, is it possible to include the ticket description on the new order email sent out. At the moment we’ve set up the different ticket dates as the ticket names, with the course and times in the description to make it tidy. What we see when we get the new customer order via WooCommerce is just the title.

    How would I add the ticket description into that section too?

    Thanks, Iain

    #1039665
    Geoff
    Member

    Hey Lain — nice to see you again!

    For the ticket description in the email, you can accomplish this by modifying the views > tickets > email.php from within the Core Events Calendar plugin (Not the WooTickets plugin) and copying the file into your active theme following our Themer’s Guide. You can then add the event description wherever you would like within that file.

    Will that work for you? Please let me know. 🙂

    Cheers!
    Geoff

    #1040594
    Iain
    Participant

    Thanks Geoff,

    What’s the syntax for the ‘ticket description’ though? I can see where to add it, but I’ve no idea what to add in.

    Thanks, Iain

    #1040844
    Geoff
    Member

    Hi Lain,

    You can this to the ticket loop in the email and it will grab the description:

    echo $ticket->description;

    Cheers!
    Geoff

    #1041388
    Iain
    Participant

    Thanks Geoff.

    OK, so I’ve added that line to the woo commerce email (WooCommerce/Templates/Emails/email-order-items.php) but it doesn’t seem to include it. Any ideas?

    Here’s the block I’ve added it to, which is what displays the name, qty, etc.

    
    			<td class="td" style="text-align:left; vertical-align:middle; border: 1px solid #eee; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; word-wrap:break-word;"><?php
    
    				// Show title/image etc
    				if ( $show_image ) {
    					echo apply_filters( 'woocommerce_order_item_thumbnail', '<div style="margin-bottom: 5px"><img src="' . ( $_product->get_image_id() ? current( wp_get_attachment_image_src( $_product->get_image_id(), 'thumbnail') ) : wc_placeholder_img_src() ) .'" alt="' . esc_attr__( 'Product Image', 'woocommerce' ) . '" height="' . esc_attr( $image_size[1] ) . '" width="' . esc_attr( $image_size[0] ) . '" style="vertical-align:middle; margin-right: 10px;" /></div>', $item );
    				}
    
    				// Product name
    				echo apply_filters( 'woocommerce_order_item_name', $item['name'], $item, false );
    				
    				// Ticket description
    				echo $ticket->description;
    
    				// SKU
    				if ( $show_sku && is_object( $_product ) && $_product->get_sku() ) {
    					echo ' (#' . $_product->get_sku() . ')';
    				}
    
    				// allow other plugins to add additional product information here
    				do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order );
    
    				// Variation
    				if ( ! empty( $item_meta->meta ) ) {
    					echo '<br/><small>' . nl2br( $item_meta->display( true, true, '_', "\n" ) ) . '</small>';
    				}
    
    				// File URLs
    				if ( $show_download_links ) {
    					$order->display_item_downloads( $item );
    				}
    
    				// allow other plugins to add additional product information here
    				do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order );
    
    			?></td>

    Thanks, Iain

    #1041643
    Geoff
    Member

    Hey Lain,

    Oh whoops, I thought you were working inside the email sent out by the ticketing plugin–sorry about that!

    It will take a little more custom development to get that going, but you should be able to grab the ticket description like this:

    $Woo__Tickets = Tribe__Events__Tickets__Woo__Main::get_instance();
    
    $ticket_ids = $Woo__Tickets->get_tickets_ids( $post_id );
    
    foreach ( $ticket_ids as $ticket_id ) {
    $ticket = $Woo__Tickets->get_ticket( $post_id, $ticket_id );
    echo $ticket->description;
    }

    Please note that this isn’t tested but is meant more as a means to give you a head start. 🙂

    Let me know if any other questions pop up as you work on this.

    Geoff

    #1041679
    Iain
    Participant

    Thanks again Geoff and sorry for the confusion.

    That doesn’t seem to do anything, although I can see what it’s trying to achieve. I just wanted to make sure $Woo__Tickets was still relevant in EC version 4 before I tried anything else.

    Thanks, Iain

    #1041691
    Geoff
    Member

    Right on! Yeah, WooCommerce Tickets is indeed still relevant and will be until we begin to merge the codebases for our ticketing platform more and more. We’ll certainly update our documentation when that happens though and will be sure to include those in our changelogs when they come. 🙂

    Cheers!
    Geoff

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Ticket Description in’ is closed to new replies.