Attendee Details in WooCommerce Zapier integration

Home Forums Ticket Products Event Tickets Plus Attendee Details in WooCommerce Zapier integration

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1222945
    Ryan
    Participant

    I’m trying to use the WooCommerce Zapier integration with Event Tickets Plus. The goal is to have a real-time updated spreadsheet of the ticket orders and attendee info.

    The plugin is pulling all the standard fields, but I’m not having any luck yet in getting attendee details into the spreadsheet. Can you tell me where that info is stored? Do you have any code snippets up your sleeve that might help with this?

    I know I’m asking for help getting your plugin to work with another plugin, which is always a tricky prospect, but any help you can offer is appreciated.

    Thanks!

    #1223370
    Cliff
    Member

    Hi, Ryan.

    For RSVP tickets, the Attendee Meta information gets stored in the _tribe_tickets_meta custom field, which is attached to a post of the tribe_rsvp_attendees custom post type.

    Similarly for WooCommerce tickets, the Attendee Meta information gets stored in the _tribe_tickets_meta custom field, which is attached to a shop_order and/or a tribe_wooticket custom post type post.

    As far as what code to leverage to get the Attendee Meta information into your application, I’d suggest looking through the files located in this directory: /wp-content/plugins/event-tickets-plus/src/Tribe/Meta/…

    I hope this gets you headed in the right direction.

    Please let me know how this goes for you. This would be a great thing for others to have too.

    #1223974
    Ryan
    Participant

    Ok, so the attendee info for Woocommerce orders isn’t actually stored in any Woocommerce meta fields. It’s only in the custom post meta field.

    I’ll let you know if we get anywhere.

    #1224046
    Cliff
    Member

    Please let us know how you get along. 🙂

    #1227961
    Ryan
    Participant

    We were able to resolve this by modifying the Zapier plugin. Thanks for the tip on where to look for the attendee info.

    #1228120
    Brian
    Participant

    Ryan,

    I’ve been following this thread, would you mind sharing how you modified that to work? Would love to get the same functionality. Thanks!
    -Brian

    #1228145
    Ryan
    Participant

    Edit the /includes/trigger/WC_Zapier_Trigger_Order.php file. Insert the new code around line 363.

    I’ve included some existing code in the snippet below to give context.

                    // Customer Notes (Private Notes aren't included)
                    // Arrays are not very well supported by Zapier at this point, but we'll send the data anyway
                    $order->notes = array(); // Array of order notes
                    foreach ( $this->wc_order->get_customer_order_notes() as $order_note_data ) {
                            $note               = new stdClass();
                            $note->note         = $order_note_data->comment_content;
                            $note->date         = WC_Zapier::format_date( $order_note_data->comment_date );
                            $note->author       = $order_note_data->comment_author;
                            $note->author_email = $order_note_data->comment_author_email;
                            $order->notes[]     = $note;
                    }
    
                    // event ticket data : Strider
                    $order->ticket_info      = array();
                    $ticket_meta = get_post_meta( $order_id , '_tribe_tickets_meta') ;
                    $ticket_meta = array_pop( $ticket_meta );
    
                    foreach( $ticket_meta as $key => &$meta )
                    {
                            foreach( $meta as &$data )
                            {
                                    $data['time']           = $data['preferred-time-slot'];
                                    $data['children']       = $data['we-require-childcare-for-the-following-number-of-children'];
    
                                    unset( $data['preferred-time-slot'] );
                                    unset( $data['we-require-childcare-for-the-following-number-of-children'] );
                            }
                    }
    
                    $order->attendee_info = array_pop( $ticket_meta );
                    error_log( print_r( $order, true ), 3, dirname( __FILE__ )."/log.txt");
                    // --- ticket data end --- //
    
                    // Order data needs to be an array.
                    $order = (array) $order;
    

    So far this is working for us. There’s always the possibility of refinement 🙂

    #1228289
    Brian
    Participant

    Thanks Ryan this will help out a lot!

    #1228293
    Ryan
    Participant

    We’re working on ways to make it more portable between tickets/events/sites but that gives you the general idea 🙂

    #1229207
    Cliff
    Member

    Ryan, thanks so much for sharing your integration with https://woocommerce.com/products/woocommerce-zapier/!

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Attendee Details in WooCommerce Zapier integration’ is closed to new replies.