Home › Forums › Ticket Products › Event Tickets Plus › Ticket Description in
- This topic has 7 replies, 2 voices, and was last updated 10 years, 4 months ago by
Geoff.
-
AuthorPosts
-
December 10, 2015 at 8:04 am #1038895
Iain
ParticipantHi, 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
December 11, 2015 at 8:20 am #1039665Geoff
MemberHey 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!
GeoffDecember 14, 2015 at 2:03 am #1040594Iain
ParticipantThanks 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
December 14, 2015 at 7:13 am #1040844Geoff
MemberHi Lain,
You can this to the ticket loop in the email and it will grab the description:
echo $ticket->description;Cheers!
GeoffDecember 15, 2015 at 3:27 am #1041388Iain
ParticipantThanks 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
December 15, 2015 at 6:51 am #1041643Geoff
MemberHey 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
December 15, 2015 at 7:30 am #1041679Iain
ParticipantThanks 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
December 15, 2015 at 7:39 am #1041691Geoff
MemberRight 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 -
AuthorPosts
- The topic ‘Ticket Description in’ is closed to new replies.
