Add a name to every ticket on checkout so it can be shown on the attendees list

Home Forums Ticket Products Event Tickets Plus Add a name to every ticket on checkout so it can be shown on the attendees list

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1113673
    impressiondp
    Participant

    Right now i have a client needing the checkout to loop through every item in the checkout that is a ticket and assign a customers name and email to it so im able to pull that infromation from the order information and display custom info on the attendeed list.

    My question to you is there an easy way to do this as i see you have somethin similar for RSVP but these tickets are to buy and the information must be collected on the checkout page. My plan is to have the checkout page in 2 steps with the first page showing a name and email field for every quantity of every ticket. Once they are all complete and the next page is hit all this data is sorted in a browser session which once the order complete action is it is plotted within the order data and “HOPEFULLY” pulled out and matched on the tickets.
    Its alot of work so hopefully you guys have a simpler idea!
    Thanks
    Adam

    #1113882
    Cliff
    Member

    Hi. Am I understanding your question completely?:

    1. if someone purchases multiple tickets at once,
    2. you have questions to ask of each ticket (e.g. name, email, t-shirt size)
    3. and for each ticket, you want to send an email to each email address (e.g. name, email, t-shirt size), and not just the individual purchaser

    Once I fully understand your question, I might be able to share some helpful information, but please understand that we are limited in our customization support, per our Scope of Support / Terms.

    #1115798
    impressiondp
    Participant

    In a way yes you are correct, we have a 2 stage checkout that at stage 1 lists all the tickets and asks for a users email address for each ticket. EG: A single event ticket has a quanitiy of 3, we ask for 3 peoples emails for this ticket.

    Our end game is assigning these emails next to an atendee_id’s within the attendees list/csv export list on the admin page.
    This is the stage where im not sure of the logical route to take and need assistance, here are my 2 thought processes:

    Option 1: At the end of the checkout process we fire an action that gets the order and we call upon out list of ticket to customer emails and assign them to the generated attendee ids. Unfortunatly i have no idea how to get the atendee ides and where this meta is stored for me to save it or at what point the action should be called up.
    Ideally i would love to call upon some on the new functionality you have done to assign individual meta to tickets i have seen with the latest release.

    add_action( ‘woocommerce_checkout_update_order_meta’, ‘add_ticket_to_user_info_to_order’ );
    function add_ticket_to_user_info_to_order( $order_id ) {

    if ( ! empty( $aTicketsToUsers ) && is_array($aTicketsToUsers)){
    /*
    SOMEHOW ADD THE USERS EMAIL TO EACH ATENDEE ID FOR EACH ORDER/TICKET

    */
    }
    }

    Option2: Serialise the array of tickets to user emails and and save this to the meta_value against the order object then on the admin listing page of atendees unserialise it and assign an email randomly to each atendee as the attendee list is being spat out. not idea though as there is no hard meta data stored against each attendee id.

    #1116143
    Cliff
    Member

    Adam, as both the options you laid out are in-depth customizations, we’re limited in how much we can help, as stated earlier. I hope you understand.

    #1116268
    impressiondp
    Participant

    Hi Cliff, are you at least able to tell me the name of the action that is fired when the atendeed ids are created so i can hook into it?

    #1116632
    Cliff
    Member

    wootickets_generate_ticket_attendee is probably what you’re looking for, which receives $attendee_id, $event_id, $order and $product_id (if the callback requests them).

    Also, since it’s just a custom post type, you could just use standard WP hooks that fire on post creation.

    I hope this helps!

    #1116898
    impressiondp
    Participant

    Hi Cliff, thanks for your time on this.
    One final question and it “should” be a simple one:
    Im hooking into the “event_tickets_woocommerce_ticket_created” function as you suggested with the following code but im pritty confident this action is not being fired at all and im stumped as to when it should be.

    Ive purchased the ticket and even gone into the orders page to make sure its completed BUT when i get all the meta using the attendee ID as the ket nothing has been saved to its meta. Ive even thrown some DIE statements in below and at no point has this been fired to show me that die.

    Am i missing something about implementing this?

    do_action( ‘event_tickets_woocommerce_ticket_created’, ‘add_meta_to_ticket_attendees_woo’ );
    function add_meta_to_ticket_attendees_woo( $attendee_id, $order_id, $product_id, $order_attendee_id ){
    update_post_meta( $attendee_id, ‘order_id_event_tickets’, $order_id);
    update_post_meta( $attendee_id, ‘order_attendee_id_event_tickets’, $order_attendee_id);
    update_post_meta( $attendee_id, ‘product_id_event_tickets’, $product_id);
    }

    Once i get this firing and returnign the params all my work will be done!
    Thank you kindly

    #1117268
    Cliff
    Member

    I think you should be using add_action() instead of do_action()

    I hope that gets you further down the road…

    #1122579
    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 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Add a name to every ticket on checkout so it can be shown on the attendees list’ is closed to new replies.