{"id":1277256,"date":"2017-05-02T07:37:40","date_gmt":"2017-05-02T14:37:40","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-woocommerce-order-notes-to-attendees-export\/"},"modified":"2017-05-03T21:06:06","modified_gmt":"2017-05-04T04:06:06","slug":"adding-woocommerce-order-notes-to-attendees-export","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-woocommerce-order-notes-to-attendees-export\/","title":{"rendered":"Adding WooCommerce Order Notes to Attendees Export"},"content":{"rendered":"<p>I have successfully set up a site to export several WooCommerce order fields in the Attendees CSV Export. However, I&#8217;m also looking to get the Order Notes from each order into the export (it details the transaction and status info, like in the accompanying image). That&#8217;s proving to be a bit more of a challenge.<\/p>\n<p>I tried the following code, with several variations, but no luck in getting the notes to appear in the export:<\/p>\n<pre><code>\/* Tribe, adding user meta to the attendees csv export *\/\r\nfunction tribe_export_custom_set_up ( $event_id ) {\r\n\r\n\t\/\/Add Handler for Community Tickets to Prevent Notices in Exports\r\n\tif ( ! is_admin() ) {\r\n\t\t$screen_base = 'tribe_events_page_tickets-attendees';\r\n\t} else {\r\n\t\t$screen      = get_current_screen();\r\n\t\t$screen_base = $screen-&gt;base;\r\n\t}\r\n\t$filter_name = \"manage_{$screen_base}_columns\";\r\n\r\n\tadd_filter( $filter_name, 'tribe_export_custom_add_columns', 100 );\r\n\tadd_filter( 'tribe_events_tickets_attendees_table_column', 'tribe_export_custom_populate_columns', 10, 3 );\r\n}\r\nadd_action( 'tribe_events_tickets_generate_filtered_attendees_list', 'tribe_export_custom_set_up' );\r\n\r\nfunction tribe_export_custom_add_columns ( $columns ) {\r\n$columns['billing_first_name'] = 'Billing First Name';\r\n$columns['billing_last_name'] = 'Billing Last Name';\r\n$columns['billing_company'] = 'Billing Company';\r\n$columns['billing_address_1'] = 'Billing Address 1';\r\n$columns['billing_address_2'] = 'Billing Address 2';\r\n$columns['billing_city'] = 'Billing City';\r\n$columns['billing_state'] = 'Billing State';\r\n$columns['billing_postcode'] = 'Billing Zip';\r\n$columns['billing_phone'] = 'Phone';\r\n$columns['billing_email'] = 'Email';\r\n\r\n$columns['shipping_first_name'] = 'Shipping First Name';\r\n$columns['shipping_last_name'] = 'Shipping Last Name';\r\n$columns['shipping_company'] = 'Shipping Company';\r\n$columns['shipping_address_1'] = 'Shipping Address 1';\r\n$columns['shipping_address_2'] = 'Shipping Address 2';\r\n$columns['shipping_city'] = 'Shipping City';\r\n$columns['shipping_state'] = 'Shipping State';\r\n$columns['shipping_postcode'] = 'Shipping Zip';\r\n\r\n$columns['order_comments'] = 'Order Comments';\r\n\r\n$columns['order_date'] = 'Order Date';\r\n$columns['order_notes'] = 'Order Notes';\r\nreturn $columns;\r\n}\r\n\r\nfunction tribe_export_custom_populate_columns ( $value, $item, $column ) {\r\n \r\n$order = new WC_Order( $item['order_id'] );\r\n\r\n$date = utf8_decode($order-&gt;order_date);\r\n\r\n$bfirst = utf8_decode($order-&gt;billing_first_name);\r\n$blast = utf8_decode($order-&gt;billing_last_name);\r\n$bcompany = utf8_decode($order-&gt;billing_company);\r\n$badd1 = utf8_decode($order-&gt;billing_address_1);\r\n$badd2 = utf8_decode($order-&gt;billing_address_2);\r\n$bcity = utf8_decode($order-&gt;billing_city);\r\n$bstate = utf8_decode($order-&gt;billing_state);\r\n$bzip = utf8_decode($order-&gt;billing_postcode);\r\n$phone = utf8_decode($order-&gt;billing_phone);\r\n$email = utf8_decode($order-&gt;billing_email);\r\n\r\n$sfirst = utf8_decode($order-&gt;shipping_first_name);\r\n$slast = utf8_decode($order-&gt;shipping_last_name);\r\n$scompany = utf8_decode($order-&gt;shipping_company);\r\n$sadd1 = utf8_decode($order-&gt;shipping_address_1);\r\n$sadd2 = utf8_decode($order-&gt;shipping_address_2);\r\n$scity = utf8_decode($order-&gt;shipping_city);\r\n$sstate = utf8_decode($order-&gt;shipping_state);\r\n$szip = utf8_decode($order-&gt;shipping_postcode);\r\n\r\n$custcomments = utf8_decode($order-&gt;order_comments);\r\n\r\n$notes = utf8_decode($order-&gt;get_customer_order_notes);\r\n\r\n \r\nif ( isset($order) ) {\r\n \r\n    switch ($column) {  \r\n\t\r\n\t case 'order_date':\r\n            $value = $date;\r\n        break;\r\n\t\r\n\t    case 'billing_first_name':\r\n            $value = $bfirst;\r\n        break;\r\n\t\t\r\n\t\tcase 'billing_last_name':\r\n            $value = $blast;\r\n        break;\r\n\t\t\r\n\t\tcase 'billing_company':\r\n            $value = $bcompany;\r\n        break;\r\n\t\t\r\n\t\tcase 'billing_address_1':\r\n            $value = $badd1;\r\n        break;\r\n\t\t\r\n\t\tcase 'billing_address_2':\r\n            $value = $badd2;\r\n        break;\r\n\t\t\r\n\t\tcase 'billing_city':\r\n            $value = $bcity;\r\n        break;\r\n\t\t\r\n\t\tcase 'billing_state':\r\n            $value = $bstate;\r\n        break;\r\n\t\t\r\n\t\tcase 'billing_postcode':\r\n            $value = $bzip;\r\n        break;\r\n\t\t\r\n\t\tcase 'billing_phone':\r\n            $value = $phone;\r\n        break;\r\n\t\t\r\n\t\tcase 'billing_email':\r\n            $value = $email;\r\n        break;\r\n\t\t\r\n\t\t\r\n\t\tcase 'shipping_first_name':\r\n            $value = $sfirst;\r\n        break;\r\n\t\t\r\n\t\tcase 'shipping_last_name':\r\n            $value = $slast;\r\n        break;\r\n\t\t\r\n\t\tcase 'shipping_company':\r\n            $value = $scompany;\r\n        break;\r\n\t\t\r\n\t\tcase 'shipping_address_1':\r\n            $value = $sadd1;\r\n        break;\r\n\t\t\r\n\t\tcase 'shipping_address_2':\r\n            $value = $sadd2;\r\n        break;\r\n\t\t\r\n\t\tcase 'billing_city':\r\n            $value = $scity;\r\n        break;\r\n\t\t\r\n\t\tcase 'shipping_state':\r\n            $value = $sstate;\r\n        break;\r\n\t\t\r\n\t\tcase 'shipping_postcode':\r\n            $value = $szip;\r\n        break;\r\n\t\t\r\n\t\t\r\n\t\tcase 'order_comments':\r\n            $value = $custcomments;\r\n        break;\r\n\t\t\r\n\t\tcase 'get_customer_order_notes':\r\n            $value = $notes;\r\n        break;\r\n}\r\n    } else {\r\n        $value = '-';\r\n    }\r\n    return $value;\r\n}<\/code><\/pre>\n<p>I believe that WooCommerce handles the Order Notes as a standard WordPress comment. Do you have any suggestions about what might work in getting this into the Attendees export?<\/p>\n","protected":false},"template":"","class_list":["post-1277256","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Adding WooCommerce Order Notes to Attendees Export -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-woocommerce-order-notes-to-attendees-export\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Adding WooCommerce Order Notes to Attendees Export -\" \/>\n<meta property=\"og:description\" content=\"I have successfully set up a site to export several WooCommerce order fields in the Attendees CSV Export. However, I&#8217;m also looking to get the Order Notes from each order into the export (it details the transaction and status info, like in the accompanying image). That&#8217;s proving to be a bit more of a challenge. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-woocommerce-order-notes-to-attendees-export\/\" \/>\n<meta property=\"article:modified_time\" content=\"2017-05-04T04:06:06+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-woocommerce-order-notes-to-attendees-export\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-woocommerce-order-notes-to-attendees-export\/\",\"name\":\"Adding WooCommerce Order Notes to Attendees Export -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-05-02T14:37:40+00:00\",\"dateModified\":\"2017-05-04T04:06:06+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-woocommerce-order-notes-to-attendees-export\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-woocommerce-order-notes-to-attendees-export\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-woocommerce-order-notes-to-attendees-export\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Ticket Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Event Tickets Plus\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/event-tickets-plus\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Adding WooCommerce Order Notes to Attendees Export\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Adding WooCommerce Order Notes to Attendees Export -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-woocommerce-order-notes-to-attendees-export\/","og_locale":"en_US","og_type":"article","og_title":"Adding WooCommerce Order Notes to Attendees Export -","og_description":"I have successfully set up a site to export several WooCommerce order fields in the Attendees CSV Export. However, I&#8217;m also looking to get the Order Notes from each order into the export (it details the transaction and status info, like in the accompanying image). That&#8217;s proving to be a bit more of a challenge. [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-woocommerce-order-notes-to-attendees-export\/","article_modified_time":"2017-05-04T04:06:06+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-woocommerce-order-notes-to-attendees-export\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-woocommerce-order-notes-to-attendees-export\/","name":"Adding WooCommerce Order Notes to Attendees Export -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-05-02T14:37:40+00:00","dateModified":"2017-05-04T04:06:06+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-woocommerce-order-notes-to-attendees-export\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-woocommerce-order-notes-to-attendees-export\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/adding-woocommerce-order-notes-to-attendees-export\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Ticket Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/"},{"@type":"ListItem","position":4,"name":"Event Tickets Plus","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/event-tickets\/event-tickets-plus\/"},{"@type":"ListItem","position":5,"name":"Adding WooCommerce Order Notes to Attendees Export"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1277256","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1277256\/revisions"}],"predecessor-version":[{"id":1278373,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1277256\/revisions\/1278373"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1277256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}