Forum Replies Created
-
AuthorPosts
-
Jayson Cote
ParticipantThanks Victor, I do have a staging site setup and will run some more tests there. I do not have any custom functions effecting the csv export specifically, although I do have a couple column filters in place. Maybe these filters are effecting the export?
//* Add columns to attendee screen
add_filter( ‘manage_tribe_events_page_tickets-attendees_columns’, ‘gum_woo_custom_attendee_column_manage’, 20 );
add_filter( ‘tribe_events_tickets_attendees_table_column’, ‘gum_woo_custom_attendee_column_display’, 10, 3 );Thanks for the response. I will run some more tests..
Jayson Cote
Participant@gergana – The line Display TEC ticket meta field value on the order admin page, is just a comment describing the action for the code snippet. You can use the same code snippet to have the attendee ticket info displayed in other areas, by calling the function with a different hook or filter. Examples:
To display on the Woocommerce Admin order screen
add_action( 'woocommerce_admin_order_data_after_shipping_address', 'replace_with_your_function_name', 10, 1 );
To display in order email notifications
add_action( 'woocommerce_email_customer_details', 'replace_with_your_function_name' );Jayson Cote
Participant@gergana I have updated the snippet for you. Simply place in your child theme functions.php file. FYI you will need to update the field slug names to be the same as the fields that you have created. The field slug name are indicated between the square brackets within the single quotation marks, i.e. [‘first-name’]
//** Display TEC ticket meta field value on the order admin page add_action( 'woocommerce_order_details_after_customer_details', 'gum_woo_ticket_fields_display_admin', 10, 1 ); function gum_woo_ticket_fields_display_admin( $order ) { // TEC ticket meta fields - get data $fieldset_meta = get_post_meta( $order->id, Tribe__Tickets_Plus__Meta::META_KEY, true ); //If No fields set, do not process if (! $fieldset_meta ) return; //If fields set, loop and display each tickets data for($i = 0; $i < count($fieldset_meta); $i++) { $att_ticket_title = get_the_title($keys[$i]); echo '<h4>'. $att_ticket_title .'</h4>'; foreach( $fieldset_meta[$keys[$i]] AS $key => $value ) { $att_fname = (isset( $value['first-name'] )) ? $value['first-name'] : ''; $att_lname = (isset( $value['last-name'] )) ? $value['last-name'] : ''; $att_email = (isset( $value['email'] )) ? $value['email'] : 'this'; $att_phone = (isset( $value['phone'] )) ? $value['phone'] : ''; $att_profession = (isset( $value['profession'] )) ? $value['profession'] : ''; $att_license = (isset( $value['license'] )) ? $value['license'] : ''; echo '<p>'; echo '<strong>Attendee - '. ($key + 1) .'</strong><br />'; echo 'Name: '. $att_fname .' '. $att_lname .'<br />'; echo 'Email: '. $att_email .'<br />'; echo 'Phone: '. $att_phone .'<br />'; echo 'Profession: '. $att_profession .'<br />'; echo 'License #: '. $att_license .'<br />'; echo '</p>'; } //end foreach } //end for } // end functionJayson Cote
Participant@esthers525 If you’re interested, I have a code snippet here that will allow you to extract the ticket fieldset field data submitted with each ticket.
You will need to edit the field slug names to match your own field names, which you can see in the code identified between single quotes and square brackets. You will also need to get the order ID to return the correct values for that order. Depending on your planned usage there are several techniques to get the order ID and then hook or filter into the correct action in order to display or … with the ticket meta data.
The code below adds the ticket field values to the woocommerce customer email notice, although you can use the $fieldset_meta to get the values and do whatever you wish with them. Hope this helps.
//** Add fields to order emails - customer //add_action( 'woocommerce_email_customer_details', 'gum_woo_checkout_fields_email_customer' ); function gum_woo_checkout_fields_email_customer( $order ) { $fieldset_meta = get_post_meta( $order->id, Tribe__Tickets_Plus__Meta::META_KEY, true ); $cnt = 1; if (! $fieldset_meta ) return; echo '<h3> Course Participants </h3>'; foreach( $fieldset_meta AS $item => $value ) { foreach( $fieldset_meta[$item] AS $key => $value ) { $att_fname = (isset( $value['first-name'] )) ? $value['first-name'] : ''; $att_lname = (isset( $value['last-name'] )) ? $value['last-name'] : ''; $att_email = (isset( $value['email'] )) ? $value['email'] : ''; $att_phone = (isset( $value['phone'] )) ? $value['[phone'] : ''; $att_profession = (isset( $value['profession'] )) ? $value['profession'] : ''; $att_license = (isset( $value['license'] )) ? $value['license'] : ''; echo '<p>'; echo '<strong>Attendee - '. $cnt .'</strong><br />'; echo 'Name: '. $att_fname .' '. $att_lname .'<br />'; echo 'Email: '. $att_email .'<br />'; echo 'Phone: '. $att_phone .'<br />'; echo 'Profession: '. $att_profession .'<br />'; echo 'License #: '. $att_license .'<br />'; echo '</p>'; $cnt++; } } }August 1, 2016 at 11:30 am in reply to: Adding Attendee Data to WooCommerce Email Confirmation #1146203Jayson Cote
Participant@frankgribbin, just wanted to offer my solution. I have a few attendee fields set in the ticket field sets to collect information for each ticket. I use the following code to get the submitted data from the field sets and display on the admin order screen, email notices etc. You will need to use the proper woocommerce action hook or filter for the function you are wishing to effect.
//** Add fields to order emails - customer //add_action( 'woocommerce_email_customer_details', 'gum_woo_checkout_fields_email_customer' ); function gum_woo_checkout_fields_email_customer( $order ) { //* NEW $fieldset_meta = get_post_meta( $order->id, Tribe__Tickets_Plus__Meta::META_KEY, true ); $cnt = 1; if (! $fieldset_meta ) return; echo '<h3> Course Participants </h3>'; foreach( $fieldset_meta AS $item => $value ) { foreach( $fieldset_meta[$item] AS $key => $value ) { $att_fname = (isset( $value['first-name'] )) ? $value['first-name'] : ''; $att_lname = (isset( $value['last-name'] )) ? $value['last-name'] : ''; $att_email = (isset( $value['email'] )) ? $value['email'] : ''; $att_phone = (isset( $value['phone'] )) ? $value['[phone'] : ''; $att_profession = (isset( $value['profession'] )) ? $value['profession'] : ''; $att_license = (isset( $value['license'] )) ? $value['license'] : ''; echo '<p>'; echo '<strong>Attendee - '. $cnt .'</strong><br />'; echo 'Name: '. $att_fname .' '. $att_lname .'<br />'; echo 'Email: '. $att_email .'<br />'; echo 'Phone: '. $att_phone .'<br />'; echo 'Profession: '. $att_profession .'<br />'; echo 'License #: '. $att_license .'<br />'; echo '</p>'; $cnt++; } } }-
This reply was modified 9 years, 8 months ago by
Jayson Cote. Reason: edited @username
Jayson Cote
ParticipantI as well would like to be notified of this update, thank you
May 10, 2014 at 3:29 pm in reply to: Editing Order, adding and removing tickets, updating attendee list #156600Jayson Cote
ParticipantThanks for the explanation Casey. I look forward to next release having this additional feature to delete and (hopefully) add users to the attendee lists. On a more technical note, may you have a dev give me the correct database items and item id’s to edit a purchased ticket’s association from one event (attendee list) to a different event and attendee list? I am ssuming that the data’s relationships can be edited within the database tables to associate a ticket with a different event and attendee list.
Jayson Cote
Participant@vinejuice, check out the following snippet, it shows the wooticket price on the events page along with a notice if stock is below or equal to 5. Hope this may help you in the right direction.
https://gist.github.com/jtcote/68313654cea6fb46f5f5#file-tribe-events-show-cost-availability-phpJayson Cote
Participant@Tony if you look at the top of the file there is a comment:
“Override this template in your own theme by creating a file at [your-theme]/tribe-events/tickets/email.php”
Hope that helps.Jayson Cote
ParticipantHI Barry, I am also having an issue with an inaccurate number of tickets sold being displayed. My scenario:
1) Add ticket to existing order
2) Reduce line item stock
3) Save order
The customer shows in the event attendee list, although the ‘Tickets Sold’ does not update -
This reply was modified 9 years, 8 months ago by
-
AuthorPosts
