Home › Forums › Ticket Products › Event Tickets Plus › Get event title from associated ticket to output in cart
- This topic has 6 replies, 2 voices, and was last updated 11 years, 11 months ago by
Casey D.
-
AuthorPosts
-
April 29, 2014 at 5:46 am #145281
teamworks
ParticipantI want to do what the guys on this thread did but I’m struggling with the code
https://tri.be/support/forums/topic/event-title-on-checkout-page/The reason is because when several tickets are added to the cart it’s not clear what event they are for so I want to output the event name before the ticket. Can anyone help with the actual code?
April 29, 2014 at 4:05 pm #145797Casey D
MemberHello teamworks,
Thanks for contacting us! Typically that level of customization goes beyond the scope of the forums, as it is just too time consuming to help all users.
If you reply back to what code you currently have though, I could probably offer you pointers/guidance pretty quickly. A pastie or gist might be more suitable than pasting it directly into the forums.
Cheers!
– Casey Driscoll
April 30, 2014 at 12:51 am #146162teamworks
ParticipantMay 2, 2014 at 9:05 am #148246Casey D
MemberHello teamworks,
Sorry for the delay. I think this problem is beyond the scope of my current expertise and beyond the scope of the forums.
That said, I’ll leave this thread open and revisit in the next few days if I have time or if you have developments, just as a matter of personal curiosity. Officially I cannot offer any support on this customization, especially as we are swamped right now, but if I get a few free brain cycles later I’ll see if I can revisit later. I think there might be other user that would be potentially interested in this solution, and we could make a tutorial from it if it succeeds.
Feel free to post any updates that I may take a look at.
Cheers!
– Casey Driscoll
May 8, 2014 at 3:33 am #153683teamworks
ParticipantHi,
I ended up solving it by creating an edd_templates folder in my theme, copying ‘checkout_cart.php’ to it and adding the code below:
<td class="edd_cart_item_name">
<?php
if ( current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail( $item['id'] ) ) {
echo '<div class="edd_cart_item_image">';
echo get_the_post_thumbnail( $item['id'], apply_filters( 'edd_checkout_image_size', array( 25,25 ) ) );
echo '</div>';
}$eventID = get_post_meta( $item['id'], '_tribe_eddticket_for_event', true );
if($eventID) {
$event = get_post($eventID);
echo '<div><span class="edd_checkout_cart_item_title">' . $event->post_title . '</span></div>';
}$item_title = get_the_title( $item['id'] );
if ( ! empty( $item['options'] ) && edd_has_variable_prices( $item['id'] ) ) {
$item_title .= ' - ' . edd_get_cart_item_price_name( $item );
}
echo '<span class="edd_checkout_cart_item_title">' . esc_html( $item_title ) . '</span>';wp_reset_query();
?>
</td>
May 8, 2014 at 3:37 am #153688teamworks
ParticipantSorry output above is messed up and can’t seem to edit it…
the relevant code is:
$eventID = get_post_meta( $item[‘id’], ‘_tribe_eddticket_for_event’, true );
if($eventID) {
$event = get_post($eventID);
echo ‘[div][a href=”‘.get_permalink($eventID).'”][span class=”edd_checkout_cart_item_title”]’ . $event-]post_title . ‘[/span][/a][/div]’;
}(replacing square brackets around html!)
May 8, 2014 at 8:48 am #153892Casey D
MemberAwesome. Thanks for posting this, it will be useful in the future for other users.
We’d love it if you would leave us a review and let people know how much you like the plugin! http://m.tri.be/jt
I’ll go ahead and close this thread. Let us know if we can help with anything else.
– Casey Driscoll
-
AuthorPosts
- The topic ‘Get event title from associated ticket to output in cart’ is closed to new replies.
