Adding ticket meta data in cart to woocommerce order line meta data.

Home Forums Ticket Products Event Tickets Plus Adding ticket meta data in cart to woocommerce order line meta data.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1571166
    jaladesign
    Participant

    Hi,

    I’m trying to add ticket meta data (attendee first and last name) from tickets in the cart to the orders line item meta data using the “woocommerce_checkout_create_order_line_item” action.

    The end goal here is to use this so that in combination with the Woocommerce Zapier plugin I can send the attendees names to salesforce with the order line item data.

    At the moment the question I have is, is there a way to access the ticket meta data before an order has been completed?

    I know I can get the meta information after the order has been created, using the order id e.g. “$order_ticket_meta = get_post_meta($order_id, ‘_tribe_tickets_meta’, true);”. However I need to get this information before the order has been created.

    Or could you let me know how the ticket meta data is stored in the cart before the order is processed and if there is anyway for me to access that data?

    I understand that because this is customisation that your help here will be limited, but if you could send me in the right direction I’d appreciate it.

    Thanks

    #1573208
    Victor
    Keymaster

    Hi Jarrad!

    Thanks for getting in touch with us!

    Let me try to at least point you to a couple of things you can check to accomplish what you are looking for.

    You should take a look at theĀ generate_tickets() function located at /wp-content/plugins/event-tickets-plus/src/Tribe/Commerce/WooCommerce/Main.php

    This function triggers on ‘woocommerce_checkout_update_order_meta’ and ‘woocommerce_order_status_changed’ actions to generate the tickets for each attendee.

    Inside the generate_tickets() function you will see action hooks like ‘event_ticket_woo_attendee_created’ and others that may be of help.

    Or could you let me know how the ticket meta data is stored in the cart before the order is processed and if there is anyway for me to access that data?

    I know the attendee information is stored in a cookie throughout the checkout process until the order is placed and the tickets are generated, but I’m not really sure how it could be possible to access that data during that process.

    I hope that helps as a starting point šŸ™‚

    Best,
    Victor

    #1588781
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Adding ticket meta data in cart to woocommerce order line meta data.’ is closed to new replies.