Home › Forums › Ticket Products › Event Tickets Plus › Woocommerce address field in CSV
- This topic has 9 replies, 2 voices, and was last updated 6 years, 9 months ago by Penny Scaffold.
-
AuthorPosts
-
July 12, 2017 at 7:33 am #1320006Penny ScaffoldParticipant
Hi,
I’ve been trying to implement the CSV example listed here:
https://theeventscalendar.com/support/forums/topic/woocommerce-info-in-csv-export/#post-1234702However I am continually getting errors with the first function:
Parse error: syntax error, unexpected ‘add_filter’ (T_STRING)for add_filter( $filter_name, ‘tribe_export_custom_add_columns’, 100 );
Function below:
function tribe_export_custom_set_up ( $event_id ) {//Add Handler for Community Tickets to Prevent Notices in Exports
if ( ! is_admin() ) {
$screen_base = ‘tribe_events_page_tickets-attendees’;
} else {
$screen = get_current_screen();
$screen_base = $screen->base;
}
$filter_name = “manage_{$screen_base}_columns”;
add_filter( $filter_name, ‘tribe_export_custom_add_columns’, 100 );
add_filter( ‘tribe_events_tickets_attendees_table_column’, ‘tribe_export_custom_populate_columns’, 10, 3 );
}
add_action( ‘tribe_events_tickets_generate_filtered_attendees_list’, ‘tribe_export_custom_set_up’ );I’ve tried:
– Adding the function to a completely different theme
– Editing the function to remove anything that might be offendingBut I still cannot get it to work and just get the error message with a white screen.
Can you advise as to where I might be going wrong – I’m copying it directly, the thread is recent and others don’t seem to have had an issue with it?
Many thanks,
Penny
July 13, 2017 at 7:37 am #1320541AndrasKeymasterHello again Penny,
Sorry you are having this issue.
I see you only pasted part of the code in here. Did you paste all of this into your functions.php?
As an alternative you can give this extension a try to see if that exports the phone number to the csv file, and based on that you can adjust it to export the fields you need.
Does this help?
Andras
July 14, 2017 at 4:29 am #1321140Penny ScaffoldParticipantHi,
I’m afraid this still isn’t working. I’ve actioned the following to be sure
– the entire function
– in a fresh WordPress install
– on different hosting with a fresh theme
– with only the absolute minimum plugins required and all up to date with the latest version
– php version 5.6.31and am still getting the same error:
Parse error: syntax error, unexpected ‘add_filter’ (T_STRING)for this line:
add_filter( $filter_name, ‘tribe_export_custom_add_columns’, 100 );However I’ve tried adapting the function and regardless of how it is adapted it still continues to return errors.
Unfortunately without this ability we won’t be able to proceed with using this plugin as it is critical for our CRM that we download the billing details with the tickets in the CSV. But I’m sure this is an implementation issue as others have managed this successfully!
– I’m assuming this function should be placed in the functions.php file?
– Would there be any conflict with this function and the latest versions of Event Tickets, Event Tickets Plus or WooCommerce that I am using?Many thanks for your help,
Penny
July 14, 2017 at 6:37 am #1321177AndrasKeymasterHi Penny,
I have checked that snippet from the original source and I also got the issue. It looks like when you copy-paste from there some invisible characters also get pasted which make the code corrupt.
I cleaned it up and this one didn’t give me any errors any more. Try copying it from here:
https://gist.github.com/andrasguseo/42ddab060677ec3dc8d18ff0438d39d1
Let me know if this fixes it.
Cheers,
AndrasJuly 14, 2017 at 6:56 am #1321191Penny ScaffoldParticipantHi,
I cannot thank you enough, that worked perfectly getting the user ID! I am now struggling to get the WC billing address and info, which is the bit I really need.
I’ve used the suggestion offered here:
https://theeventscalendar.com/support/forums/topic/woocommerce-info-in-csv-export/#dl_post-1244383However the CSV is then full of the following:
<b>Notice</b>: billing_first_name was called incorrectly. Order properties should not be accessed directly. Backtrace: require_once(‘wp-admin/admin.php’)
<b>Notice</b>: billing_last_name was called incorrectly. Order properties should not be accessed directly. Backtrace: require_once(‘wp-admin/admin.php’)
<b>Notice</b>: billing_address_1 was called incorrectly. Order properties should not be accessed directly. Backtrace: require_once(‘wp-admin/admin.php’)etc. which stems from
$firstname = utf8_decode($order->billing_first_name);
$lastname = utf8_decode($order->billing_last_name);
$address = utf8_decode($order->billing_address_1) . ‘ / ‘ . $order->billing_postcode . ‘ / ‘ . utf8_decode($order->billing_city);I am guessing perhaps an update to WooCommerce or Tickets Plus since the article was written means we need to call billing_first_name etc. differently in order for this to work? I’d really very much appreciate any help – it is so close but I am at a loss at how to fix this!
Thank you hugely,
Penny
July 17, 2017 at 6:31 am #1322083AndrasKeymasterHi Penny,
This is a bit beyond me so I will need to pull in some extra hands for this. It might take some time, so please hang in there.
Thanks for your patience!
Cheers,
AndrasJuly 17, 2017 at 8:39 am #1322137AndrasKeymasterHi Penny,
Managed to get some help / input for this from a team mate.
Here are some practical changes you can do:
– instead of
$order->billing_first_name
you can use$order->get_billing_first_name()
– instead of
$order->billing_last_name
you can use$order->get_billing_first_name()
– instead of
$order->billing_address_1
you can use$order->get_billing_address_1()
– … etc (in other words, switch from
$order->FIELD
to$order->get_FIELD()
Please note that since this already heavily involves other plugins than ours, it is already at the limits of what we can provide within our support.
If you will need further help with customization then I can share with you a list of freelancers who should be able to help you out further down the road.
Cheers,
AndrasJuly 17, 2017 at 1:52 pm #1322315Penny ScaffoldParticipantHi Andras,
Thank you so much to you and your colleague for going over and above with this one – I managed to pull a load of extra columns using https://docs.woocommerce.com/wc-apidocs/class-WC_Abstract_Order.html based on the info you’ve given me.
You’ve been awesome, thank you!
Penny
July 18, 2017 at 8:46 am #1322687AndrasKeymasterHi Penny,
I’m so happy to hear you managed to work it out! Awesome job!
Since this is marked resolved I am going to close this ticket, but if you need anything else related to this topic or another please post a new one in the forum and we will be happy to help you out.
Good luck with your project!
Cheers,
AndrasPS: If you like our plugins, and you didn’t yet do so 🙂 we would be happy to receive a review in the wordpress.org repository. Thanks!
https://wordpress.org/support/plugin/the-events-calendar/reviews/
https://wordpress.org/support/plugin/event-tickets/reviews/PS2: We’d be also grateful if you would give us feedback on your satisfaction with support. Just click on one of the classy looking emojis below. 🙂 If you can spare a few words, that’s even better. Doublethanks!
-
AuthorPosts
- The topic ‘Woocommerce address field in CSV’ is closed to new replies.