Adding Email and Adress to the Atendee CSV file

Home Forums Calendar Products Events Calendar PRO Adding Email and Adress to the Atendee CSV file

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1056397
    Aindreas
    Participant

    Hello,
    I followed the instructions for adding the phone number on this thread: https://theeventscalendar.com/support/forums/topic/add-attendee-telephone-number-to-attendee-list/#post-953675

    It works well with the phone number, and the fact it appears in the same column is not ideal, but definitely a great help.

    What I am asking is whether this can be changed to add the address of the customer aswell. I tried editing it (im no expert at php, so probably a bad attempt) by replacing phone number with billing address like so:

    NOTE: I tried billing_address first, but since that didnt work i tried shipping_address, which also didnt work.

    if ( function_exists( 'tribe_is_event') ) {
    	/**
    	 * Adds the phone number to the "Purchaser Email" column.
    	 * @link http://theeventscalendar.com/support/forums/topic/add-attendee-telephone-number-to-attendee-list/
    	 */
    	function tribe_953653_add_address_to_attendee_list( $value, $item, $column ) {
    
    		// Change this column name to move the phone number to a different column.
    		if ( 'purchaser_email' != $column ) {
    			return $value;
    		}
    
    		$shipping_address = get_post_meta( $item['order_id'], '_shipping_address', true );
    
    		// Remove the <small></small> tags from this to have the phone number text display at full size.
    		if ( ! empty( $shipping_address ) ) {
    			return $value . sprintf( '<br><b>Adress:</b> %s', sanitize_text_field( $shipping_address ) );
    		}
    
    		return $value;
    	}
    
    	add_filter( 'tribe_events_tickets_attendees_table_column', 'tribe_953653_add_address_to_attendee_list', 10, 3 );
    }
    

    Any help on how to get this to work (or whether it can work at all) would be a great help!
    Kind Regards,
    Aindreas

    #1056779
    George
    Participant

    Hey @Aindreas,

    Thanks for reaching out. We unfortunately can only marginally help with customizations – please see the “product support” section of this page for more information: http://theeventscalendar.com/terms.

    Now, I only mention our limits there to set your expectations – I’m still happy to try and help! 🙂

    I think this indeed might still work well, but needs to use different fields. WooCommerce presents a few options – here’s a screenshot of the main ones in use in our code:

    So, then, try _billing_address_1 or _shipping_address_1 instead of the versions of these keys instead of just _billing_address or _shipping_address – let me know if this makes any sort of difference here!

    Cheers,
    George

    #1056933
    Aindreas
    Participant

    Thanks for the help!
    Im at the airport and dont have time to implement the advice you posted, but I feel very confident about it.

    However, when the CSV file was exported there was no phone number, even though it appeared on the attendees screen. I am aware that this is probably a different issue and most likely one you cannot offer support for.

    If you could at let me know which php file determines the CSV export file for the attendees I could play around with it and see if I can get it to work. (if I do Ill post the results here, so dont close the thread just yet, or I could create a new ticket and post the results there if you prefer)

    Thank you for your help so far! Hope to hear from you soon!
    Kind Regards,
    Aindreas

    #1058173
    George
    Participant

    Hey @Aindreas,

    Thanks for your response. When you mention the CSV export not including the file names, just to be clear you mean the “CSV Export” feature of the Attendees table specifically? If not, can you explain which CSV export you are referring to?

    If you are referring to attendees CSV export, then to answer your question about where to find the code for that, you would have to head into your Event Tickets plugin files to this file:

    src/Tribe/Attendees_Tables.php

    Cheers!
    George

    #1066746
    Aindreas
    Participant

    Hello,

    You are right in the fact it is the attendees CSV export file I am looking for. I have looked for the file in the location you mentioned, but the closest one I found was:
    src/Tribe/Event_Tickets/Attendees_Report.php

    It does not seem to contain the php for creating the CSV export file though. I also looked at the other 2 files in the Event Tickets folder, called ‘Main’ and ‘Ticket_Email’, but to no avail.
    I started looking through a lot of the files, but I find its like looking for a needle in a haystack, there was a lot of programming involved in creating Events Calendar.

    Would you have any other ideas where the file might be or am I even looking in the right place?
    here is the full root of where I was looking for the file:
    wp-content/plugins/the-events-calendar/src/Tribe/Event_Tickets
    Should I be in the Pro version of the calendar maybe? (though I did briefly scan through it)

    Any help would be greatly appreciated, and if I do find a solution to changing the CSV export I will be sure to post it so that others can find use for it.

    Thank You for all your help so far!

    Kind Regards,
    Aindreas

    #1067240
    George
    Participant

    Hey Aindreas,

    Thanks for the update. The specific file I’m referring to is inside the Event Tickets plugin, so its full path from wp-content would look like this:

    wp-content/plugins/event-tickets/src/Tribe/Attendees_Table.php

    If you do not see this file, then in your reply can you include your “System Information” as described in this article? → https://theeventscalendar.com/knowledgebase/sharing-sys-info/

    Thanks!
    George

    #1067999
    Aindreas
    Participant

    This reply is private.

    #1068583
    George
    Participant

    Hi there,

    Thank you for this information. It shows that you are using WooCommerce Tickets, version 3.12.1 on your site.

    This whole time I have been referring to “the Event Tickets plugin”, which is NOT WooCommerce Tickets. This is our replacement plugin, “Event Tickets”. Apologies for the lack of clarity on this.

    You will need to update to Event Tickets and Event Tickets Plus before other steps can be taken here.

    The change from “WooCommerce Tickets” is written about here: https://theeventscalendar.com/retiring-our-legacy-ticket-plugins/

    And once you are ready to actually update to Event Tickets and Event Tickets Plus, you can read the following two articles for more information on the transition to these plugins:

    • https://theeventscalendar.com/knowledgebase/new-user-primer-event-tickets/
    • https://theeventscalendar.com/knowledgebase/moving-to-event-tickets-plus/

    I hope this information helpful!

    This change to Event Tickets Plus is a simple one, and to be clear, does not cost anything–you are a license-holder of WooCommerce Tickets so you will automatically have a free license for Event Tickets Plus in your account on this site → http://theeventscalendar.com/license-keys

    If you don’t find such a license key, let me know!

    Thank you for your patience here,
    George

    #1069629
    Aindreas
    Participant

    Hello George!

    Well, I guess if were talking about different plugins we will never find the same files 😀 Sorry bout that confusion!

    I have some hesitation in switching to Event Tickets (and yes, they appear in my License keys), will I have to enter all the ticket information again once I switch over? Currently there are a LOT of tickets on the site, and rewriting all of them would be quite a pain to be honest…

    Heres to hoping its an automatic transferal! 😀

    Thanks again,
    Kind Regards,
    Aindreas

    #1069908
    George
    Participant

    Hey Aindreas,

    No worries! As for the transfer of your existing ticket data, there should be no issue here; the tickets should remain intact and no data should be lost.

    That being said, we always recommend backing up your site before installing or updating any plugin or theme – not just our own software! It’s a great habit to develop when maintaining a site.

    There are many methods for backing up a WordPress site; I would recommend researching online a bit to find a method you find easiest to do, assuming that you’ll be doing backups often….

    Then, use this method to back up your site before transitioning to Event Tickets and Event Tickets Plus. That transition should not cause problems, but I do not recommend embarking on any major site change without a backup.

    I hope this information helps!

    Cheers,
    George

    #1073361
    Aindreas
    Participant

    Hello again George,

    I have been able to get the file you mentioned (wp-content/plugins/event-tickets/src/Tribe/Attendees_Table.php) but it seems to be about determining the content for the attendees page rather than the export file.

    I was able to create 2 new columns displaying the necessary information on the attendees page, but upon clicking ‘export’, neither the columns added nor the information in them is included in the export file.

    Would you know the location of the file where it is determined what is included in the export file?

    I really appreciate all the help you have provided me!

    Kind Regards,
    Aindreas

    #1073400
    George
    Participant

    Hey @Aindreas,

    The CSV is generated in a function in this file:

    src/Tribe/Tickets_Handler.php

    The function specifically is in that file and is called maybe_generate_attendees_csv().

    Cheers!
    George

    #1083913
    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 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Adding Email and Adress to the Atendee CSV file’ is closed to new replies.