{"id":1062109,"date":"2016-01-25T14:28:58","date_gmt":"2016-01-25T22:28:58","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/attendees-missing\/"},"modified":"2016-02-20T08:35:07","modified_gmt":"2016-02-20T16:35:07","slug":"attendees-missing","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/attendees-missing\/","title":{"rendered":"Attendees missing"},"content":{"rendered":"<p>With woocommerce and some payment gateways the attendees do not show up in the list (e.g. with woocommerce&#8217;s direct debit).<br \/>\nReason is that those gateways do not generate an additional entry for each order position.  But that&#8217;s what get_event_attendees() assumes. <\/p>\n<p>I rewrote it for my own needs (Every attendee will only turn up once, even when bought several tickets). maybe it helps anyway.<\/p>\n<pre><code>\tpublic function get_event_attendees( $post_id = null ) {\n\t\tif ( empty( $post_id ) ) {\n\t\t\treturn null;\n\t\t}\n\t\tglobal $wpdb;\n\n\t\t$attendees  = array();\n\t\t$ticket_ids = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance()-&gt;get_tickets_ids( $post_id );\n\n\t\t$query = &quot;\n\t\t\tSELECT order_id\n\t\t\tFROM {$wpdb-&gt;prefix}woocommerce_order_items\n\t\t\tWHERE order_item_id IN (\n\t\t\t\tSELECT order_item_id FROM {$wpdb-&gt;prefix}woocommerce_order_itemmeta\n\t\t\t\tWHERE meta_key = &#039;_product_id&#039; AND meta_value = %d )\n\t\t\tAND order_item_type = &#039;line_item&#039;\n\t\t &quot;;\n\n\t\tforeach ( $ticket_ids as $ticket_id ) {\n\t\t\t$order_ids = $wpdb-&gt;get_col( $wpdb-&gt;prepare( $query, $ticket_id ) );\n\t\t\tforeach ( $order_ids as $order_id ) {\n\t\t\t\tif ( empty( $order_id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$order        = new WC_Order( $order_id );\n\t\t\t\t$order_status = $order-&gt;get_status( $order_id );\n\t\t\t\t$attendees[]  = array(\n\t\t\t\t\t&#039;order_id&#039;           =&gt; $order_id,\n\t\t\t\t\t&#039;order_status_label&#039; =&gt; __( $order_status, &#039;woocommerce&#039; ),\n\t\t\t\t\t&#039;order_status&#039;       =&gt; $order_status,\n\t\t\t\t\t&#039;purchaser_name&#039;     =&gt; get_post_meta( $order_id, &#039;_billing_first_name&#039;, true ) . &#039; &#039; . get_post_meta( $order_id, &#039;_billing_last_name&#039;, true ),\n\t\t\t\t\t&#039;purchaser_email&#039;    =&gt; get_post_meta( $order_id, &#039;_billing_email&#039;, true ),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $attendees;\n\t}\n<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-1062109","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>Attendees missing -<\/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\/attendees-missing\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Attendees missing -\" \/>\n<meta property=\"og:description\" content=\"With woocommerce and some payment gateways the attendees do not show up in the list (e.g. with woocommerce&#8217;s direct debit). Reason is that those gateways do not generate an additional entry for each order position. But that&#8217;s what get_event_attendees() assumes. I rewrote it for my own needs (Every attendee will only turn up once, even [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/attendees-missing\/\" \/>\n<meta property=\"article:modified_time\" content=\"2016-02-20T16:35:07+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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/attendees-missing\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/attendees-missing\/\",\"name\":\"Attendees missing -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-01-25T22:28:58+00:00\",\"dateModified\":\"2016-02-20T16:35:07+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/attendees-missing\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/attendees-missing\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/attendees-missing\/#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\":\"Attendees missing\"}]},{\"@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":"Attendees missing -","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\/attendees-missing\/","og_locale":"en_US","og_type":"article","og_title":"Attendees missing -","og_description":"With woocommerce and some payment gateways the attendees do not show up in the list (e.g. with woocommerce&#8217;s direct debit). Reason is that those gateways do not generate an additional entry for each order position. But that&#8217;s what get_event_attendees() assumes. I rewrote it for my own needs (Every attendee will only turn up once, even [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/attendees-missing\/","article_modified_time":"2016-02-20T16:35:07+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/attendees-missing\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/attendees-missing\/","name":"Attendees missing -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-01-25T22:28:58+00:00","dateModified":"2016-02-20T16:35:07+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/attendees-missing\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/attendees-missing\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/attendees-missing\/#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":"Attendees missing"}]},{"@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\/1062109","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\/1062109\/revisions"}],"predecessor-version":[{"id":1062196,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1062109\/revisions\/1062196"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1062109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}