{"id":947903,"date":"2015-03-12T08:57:33","date_gmt":"2015-03-12T15:57:33","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-attendee-id-to-order-item\/"},"modified":"2015-03-17T08:30:47","modified_gmt":"2015-03-17T15:30:47","slug":"add-attendee-id-to-order-item","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-attendee-id-to-order-item\/","title":{"rendered":"Add Attendee Id to Order Item"},"content":{"rendered":"<p>I might be missing something here.  I am using product addons with wootickets and I have it populating in the attendee list table.  (would be awesome to be able to add these to the exportable CSV file).  I am getting stuck with multiple tickets in the same order.  Is there already a connection or some way to connect the attendee ID to the order item?<\/p>\n<p>I am not seeing anything between any of the variables ($existing, $item, $column) when I get the order and thus order items.  I am only able to loop through the items, but that doesn&#8217;t work when each ticket is on a different line, thus the function is being repeated for each line.<\/p>\n<p>I am guessing I can add this myself, I just wanted to know if you had something I was missing.  Or this could be a nice feature that should be fairly easy to add for people doing custom stuff.<\/p>\n<p>add_filter( &#8216;tribe_events_tickets_attendees_table_column&#8217;, &#8216;populate_my_custom_fields_column&#8217;, 10, 3 );<br \/>\nfunction populate_my_custom_fields_column( $existing, $item, $column ) {  \/\/print_r($item[&#8216;attendee_id&#8217;]);<br \/>\n\tif ( $existing !== &#8221; ) return $existing;\t\t<\/p>\n<p>\t$order = new WC_Order( $item[&#8216;order_id&#8217;] );  \/\/print_r($order); return;<br \/>\n\t$items = $order-&gt;get_items(); \/\/print_r($items); return;\t\t\/\/ Add Attendee ID to Order Item<\/p>\n<p>\tforeach ($items as $key =&gt; $order_item ) { \/\/print_r($order_item); return;<br \/>\n\t\tif ($order_item[&#8216;name&#8217;] == $item[&#8216;ticket&#8217;]) $item_id = $key;  \/\/ Not working with multiple tickets on one order, just getting the last order item for each ticket on this order &#8212; NEEDS TO BE ATTENDEE ID rather than $item[&#8216;ticket&#8217;]<br \/>\n\t}  <\/p>\n<p>\t\/\/$item_meta = $order-&gt;get_item_meta( $item_id ); print_r($item_meta); return;\/\/ It is here too<br \/>\n\t$metadata = $order-&gt;has_meta( $item_id );<br \/>\n\tforeach ( $metadata as $meta ) { <\/p>\n<p>\t\t\t\t\t\t$key = strtolower(str_replace(&#8216; &#8216;, &#8216;_&#8217;, $meta[&#8216;meta_key&#8217;]));<br \/>\n\t\t\t\t\t\t$key = str_replace(&#8216;-&#8216;, &#8221;, $key);<\/p>\n<p>\t\t\tif ($key == $column) return $meta[&#8216;meta_value&#8217;];<\/p>\n<p>\t}<\/p>\n<p>\treturn &#8216;-&#8216;;<br \/>\n}<\/p>\n<p>I hope this makes sense.  \ud83d\ude42<\/p>\n","protected":false},"template":"","class_list":["post-947903","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>Add Attendee Id to Order Item -<\/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\/add-attendee-id-to-order-item\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Add Attendee Id to Order Item -\" \/>\n<meta property=\"og:description\" content=\"I might be missing something here. I am using product addons with wootickets and I have it populating in the attendee list table. (would be awesome to be able to add these to the exportable CSV file). I am getting stuck with multiple tickets in the same order. Is there already a connection or some [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-attendee-id-to-order-item\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-03-17T15:30:47+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=\"2 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\/add-attendee-id-to-order-item\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-attendee-id-to-order-item\/\",\"name\":\"Add Attendee Id to Order Item -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-03-12T15:57:33+00:00\",\"dateModified\":\"2015-03-17T15:30:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-attendee-id-to-order-item\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-attendee-id-to-order-item\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-attendee-id-to-order-item\/#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\":\"Add Attendee Id to Order Item\"}]},{\"@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":"Add Attendee Id to Order Item -","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\/add-attendee-id-to-order-item\/","og_locale":"en_US","og_type":"article","og_title":"Add Attendee Id to Order Item -","og_description":"I might be missing something here. I am using product addons with wootickets and I have it populating in the attendee list table. (would be awesome to be able to add these to the exportable CSV file). I am getting stuck with multiple tickets in the same order. Is there already a connection or some [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-attendee-id-to-order-item\/","article_modified_time":"2015-03-17T15:30:47+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-attendee-id-to-order-item\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-attendee-id-to-order-item\/","name":"Add Attendee Id to Order Item -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-03-12T15:57:33+00:00","dateModified":"2015-03-17T15:30:47+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-attendee-id-to-order-item\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-attendee-id-to-order-item\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/add-attendee-id-to-order-item\/#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":"Add Attendee Id to Order Item"}]},{"@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\/947903","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\/947903\/revisions"}],"predecessor-version":[{"id":947991,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/947903\/revisions\/947991"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=947903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}