Duplicate Ticket Emails

Home Forums Ticket Products Event Tickets Plus Duplicate Ticket Emails

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1098107
    Brian
    Participant

    Hello,

    I’m trying to figure out why duplicate ticket emails are being sent to the purchaser? A minimum of two emails will be sent for every purchase, if the customer has more items on the order another ticket email is sent for each line item.

    So if only one ticket is on the order, 2 emails are sent.
    If one ticket and one standard product is on the order 3 ticket emails are sent etc.

    The woocommerce customer order email adds the “You’ll receive your tickets in another email.” string as many times as the number of ticket emails sent.
    The woocommerce admin email seems to add “You’ll receive your tickets in another email.” an extra two times, so if the customer email has it 3 times, the admin email has it 5.

    I was using wootickets before we upgraded to event tickets plus, not sure if that could have something to do with it?

    All plugins and WordPress are running the latest updates.

    Any ideas? Or suggestions on how to troubleshoot?

    thanks

    #1098803
    Geoff B.
    Member

    Good evening Brian and welcome back!

    Thank you for reaching out to us.

    We are sorry to hear about the extra unwanted emails being sent out when purchasing tickets.
    I would love to help you with this topic.

    As a first troubleshooting step, could you please provide us with your system information in a private reply ? (following the instructions found in the link)

    Secondly, could you tell me if you have template customizations in place (if there is a /tribe-events/ folder in your WordPress theme’s folder)

    Finally, can you confirm if you followed the following when updating to ETP ? https://theeventscalendar.com/knowledgebase/moving-to-event-tickets-plus/

    Best regards,

    Geoff B.

    #1098962
    Bahram
    Participant

    Hello,

    I’m a developer for the plugin purchaser.

    We are having the same issue, ticket orders send out 2 duplicate emails. Please advise.

    Thanks,
    -Kevin

    #1099027
    Brian
    Participant

    This reply is private.

    #1099060
    Brian
    Participant

    Geoff,

    Thank you for following up with me. To answer your questions, yes I have made template customizations and yes I followed the steps when upgrading from past versions of the plugin. I’ve done some more troubleshooting and found the cause of my issue. I added a ‘woocommerce_order_item_name’ filter shown below which was causing the issue.

    /**
       * Add event title to order line item.
       */
      add_filter( 'woocommerce_order_item_name', 'sq_woocommerce_order_item_name', 10, 2 );
      function sq_woocommerce_order_item_name( $name, $item ) {
    
        $tribe = new Tribe__Tickets_Plus__Commerce__WooCommerce__Main();
        $event_id = get_post_meta( $item['product_id'], $tribe->event_key, true );
        get_the_title( $item['product_id'] );
        get_permalink( $item['product_id'] );
        if ( tribe_events_has_tickets( $event_id ) ) {
          $link = get_permalink( $event_id );
          $event_date = tribe_get_start_date( $event_id, $display_time = true, 'M j \a\t g:ia' );
          $name = $name . ' for <a href="' . $link . '">' . get_the_title( $event_id ) . '</a> - ' . $event_date;
        }
        return $name;
      }
    

    When I didn’t call get_the_title( $item[‘product_id’] ); before if ( tribe_events_has_tickets( $event_id ) ) The name it was returning was “Order Received”. Clearly this wasn’t the correct approach so I’ve updated my code to get the event title the proper way:

    /**
       * Add event title to order line item.
       */
      add_filter( 'woocommerce_order_item_name', 'sq_woocommerce_order_item_name', 10, 2 );
      function sq_woocommerce_order_item_name( $name, $item ) {
    
        $event = tribe_events_get_ticket_event( $item['product_id'] );
        if ( $event ) {
          $link = get_permalink( $event->ID );
          $event_date = tribe_get_start_date( $event->ID, $display_time = true, 'M j \a\t g:ia' );
          $name = $name . ' for <a href="' . $link . '">' . $event->post_title . '</a> - ' . $event_date;
        }
        return $name;
      }

    Just posting this info here incase anyone else encounters a similar issue.
    Thanks for the support!

    #1099297
    Geoff B.
    Member

    @Kevin we are sorry to hear that you are experiencing a similar issue. If the awesome answer provided by Brian did not help out, I would recommend opening your own support thread in order to receive the proper attention: https://theeventscalendar.com/support/post/

    #1099299
    Geoff B.
    Member

    Good evening Brian,

    Thank you so much for so generously providing your fix to the issue.

    You are 100% right, with the current codebase, when the WooCommerce order status is changed to “Complete”, the ticket email gets triggered.

    Is there anything else I can help you with on this topic ?

    Best regards,

    Geoff B.

    #1105478
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

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