Event details in cart, checkout and emails sent

Home Forums Ticket Products Event Tickets Plus Event details in cart, checkout and emails sent

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1101869
    Vivianne
    Participant

    I searched the forum but I couldn´t solve my problem with the posts I found.

    I need following event details in the cart, the checkout and all the emails sent:
    – Event title
    – Event start date and time
    – Event venue and city

    How can I integrate this?

    I already tried the solution mentioned here (https://theeventscalendar.com/support/forums/topic/display-event-details-in-woo-cart/) but it added nothing to my cart.

    Can you help me here?

    #1102406
    Barry
    Member

    Hi Vivianne,

    Thanks for getting in touch.

    The topic you linked to is approximately 3 years old and related to a much earlier version of one of our ticketing plugins, so I’m not too surprised it didn’t work 😉

    To achieve what you want you will definitely need to do some custom coding – and it is going to mean customizing the output not only of our plugin(s) but of WooCommerce, too, so for some elements of this work you may need to refer to their documentation or connect with their support team.

    Before we go any further, though, I notice that you appear to have two valid license keys at present but neither relate to Event Tickets Plus (nor to our legacy WooTickets plugin). Did you purchase a support key for one of those plugins under a different account? Would it be possible for you to login using that account instead?

    Thanks!

    #1102409
    Vivianne
    Participant

    This reply is private.

    #1102423
    Barry
    Member

    Hi Vivianne,

    Thanks for clarifying 🙂

    So the essence of this is that in most of the views/emails you referred to you will be able to obtain the product ID. For example, within WooCommerce’s cart/cart.php template you can grab it using $cart_item['product_id'] – from there, you can use various template tags and helper functions we provide to obtain the data you are interested in.

    In terms of injecting this data into the templates in question you could either use template overrides or suitable action hooks – but since it sounds like most of the areas you want to customize are on WooCommerce’s side I’d encourage you to familiarize yourself with their code and documentation before settling on an approach.

    Does that help?

    #1102426
    Vivianne
    Participant

    I have to try this.
    When we decided for the plugins we thought something like this is included as a standard.
    I guess there are a lot of people who need this exact details in the emails etc.

    I will get back to you if I am stuck.

    Thanks a lot for the first input.

    #1102466
    Barry
    Member

    Sounds good, Vivianne.

    When we decided for the plugins we thought something like this is included as a standard.

    The main tickets email should indeed provide this information to your customers – but we don’t feel that everyone would wish to add this to the cart, checkout and receipt.

    That said, you are welcome to post feature requests detailing what you would like to see (and/or upvote or comment on existing feature requests like this one).

    Thanks again!

    #1102686
    Vivianne
    Participant

    I tried to understand all you have written, but I cannot figure out, how this special code would look like.
    Could you make an example please?
    We need to go live next week and I am stuck here with this request of the client.

    #1102719
    Barry
    Member

    Hi Vivianne,

    So within the cart template (and in the portion where $cart_item['product_id'] has been defined) you might do something like this:

    $event = tribe_events_get_ticket_event( $cart_item['product_id'] );
    
    if ( ! empty( $event ) ) {
        echo get_the_title( $event->ID );
        echo tribe_get_address( $event->ID );
    }

    Of course, you’d need to add formatting etc – but hopefully that gives you a better idea of the form your code might take?

    #1104137
    Vivianne
    Participant

    I tried your code and I was able to add the title. (After changing tribe_events_get_event_ticket to tribe_events_get_ticket_event)
    Trying to go for the rest now… 😉

    • This reply was modified 7 years, 11 months ago by Vivianne.
    #1104192
    Vivianne
    Participant

    I was able to add all the details to my cart, checkout and overview-page.
    In the emails this method doesn´t work. It adds the page-title instead of the event-title and the actual date/time instead of date/time of the event.

    Could you help me once more?
    I added this code to the file email-order-items.php in the woocommerce folder.

    $event = tribe_events_get_ticket_event( $cart_item['product_id'] );
    
    echo '<br><span class="name">'. tribe_get_events_title( $event->ID ) . '</span>';
    echo '<br><span class="date">'. tribe_get_start_date( $event->ID ) . '</span>';
    echo '<br><span class="venue">'.tribe_get_venue( $event->ID ).', <span>'. tribe_get_city( $event->ID ). '</span></span>';
    #1104199
    Barry
    Member

    Sorry for the mixup and thanks for pointing that out, I have now updated the snippet 🙂

    With regards to the email template you’re right, that won’t work there because $cart_item isn’t defined – that was just an example to get you started and was specific to the cart/cart.php template.

    However, you should be able to follow effectively the same process – only this time you would obtain the product ID by using $_product->id (within the foreach loop you see there).

    Does that help?

    #1104201
    Barry
    Member

    …As a sidenote, it looks like you have also removed the if ( ! empty( $event ) ) {} test. If there is any potential for you to sell a ‘mixed cart’ containing not only tickets but unrelated products, I’d advise restoring that 🙂

    #1104204
    Vivianne
    Participant

    It works now! You are amazing!
    Thanks a lot!

    You are right with your sidenote:
    I removed it in my try & error status to get it working. 😉
    It´s back there now.

    #1104329
    Barry
    Member

    Awesome!

    I’ll go ahead and close this topic but of course please don’t hesitate to post new topics as needed if anything else crops up – one of the team will be only too happy to help 🙂

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Event details in cart, checkout and emails sent’ is closed to new replies.