Forum Replies Created
-
AuthorPosts
-
May 20, 2016 at 2:54 am in reply to: Add a name to every ticket on checkout so it can be shown on the attendees list #1116898
impressiondp
ParticipantHi 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 kindlyMay 19, 2016 at 1:03 am in reply to: Add a name to every ticket on checkout so it can be shown on the attendees list #1116268impressiondp
ParticipantHi 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?
May 18, 2016 at 5:14 am in reply to: Add a name to every ticket on checkout so it can be shown on the attendees list #1115798impressiondp
ParticipantIn 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.
-
AuthorPosts
