Get event title from associated ticket to output in cart

Home Forums Ticket Products Event Tickets Plus Get event title from associated ticket to output in cart

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #145281
    teamworks
    Participant

    I 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?

    #145797
    Casey D
    Member

    Hello 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

    #146162
    teamworks
    Participant

    Hi Casey,

    I’ve tried this – http://pastie.org/9126437

    At the moment it isn’t outputting anything.

    #148246
    Casey D
    Member

    Hello 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

    #153683
    teamworks
    Participant

    Hi,

    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>

    #153688
    teamworks
    Participant

    Sorry 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!)

    #153892
    Casey D
    Member

    Awesome. 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

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Get event title from associated ticket to output in cart’ is closed to new replies.