Attendees missing

Home Forums Ticket Products Event Tickets Plus Attendees missing

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1062109
    Thomas
    Participant

    With woocommerce and some payment gateways the attendees do not show up in the list (e.g. with woocommerce’s direct debit).
    Reason is that those gateways do not generate an additional entry for each order position. But that’s what get_event_attendees() assumes.

    I rewrote it for my own needs (Every attendee will only turn up once, even when bought several tickets). maybe it helps anyway.

    	public function get_event_attendees( $post_id = null ) {
    		if ( empty( $post_id ) ) {
    			return null;
    		}
    		global $wpdb;
    
    		$attendees  = array();
    		$ticket_ids = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance()->get_tickets_ids( $post_id );
    
    		$query = "
    			SELECT order_id
    			FROM {$wpdb->prefix}woocommerce_order_items
    			WHERE order_item_id IN (
    				SELECT order_item_id FROM {$wpdb->prefix}woocommerce_order_itemmeta
    				WHERE meta_key = '_product_id' AND meta_value = %d )
    			AND order_item_type = 'line_item'
    		 ";
    
    		foreach ( $ticket_ids as $ticket_id ) {
    			$order_ids = $wpdb->get_col( $wpdb->prepare( $query, $ticket_id ) );
    			foreach ( $order_ids as $order_id ) {
    				if ( empty( $order_id ) ) {
    					continue;
    				}
    				$order        = new WC_Order( $order_id );
    				$order_status = $order->get_status( $order_id );
    				$attendees[]  = array(
    					'order_id'           => $order_id,
    					'order_status_label' => __( $order_status, 'woocommerce' ),
    					'order_status'       => $order_status,
    					'purchaser_name'     => get_post_meta( $order_id, '_billing_first_name', true ) . ' ' . get_post_meta( $order_id, '_billing_last_name', true ),
    					'purchaser_email'    => get_post_meta( $order_id, '_billing_email', true ),
    				);
    			}
    		}
    
    		return $attendees;
    	}
    
    #1062197
    Brook
    Participant

    Thank you for sharing this Thomas. I am going to pass it on to our lead WooCommerce gentleman and see if this sort of modification would be a goodfit for all our users. If so we can do something similar in a future version.

    Either way we will share this with folks in similar shoes. Thanks again. Cheers!

    – Brook

    #1062582
    Brook
    Participant

    Hey Thomas,

    Are you using the GoCardless direct debit plugin for Woo? Would it be possible for you to share the zip with us so we can investigate this in more detail? You could email it to support at this website.

    Cheers!
    – Brook

    #1062655
    Thomas
    Participant

    Sorry for not checking all relevant data upfront and post it here. The direct debit gateway comes with

    Germanized for WooCommerce


    A plugin often used in Germany to take care of the specific legal issues in the EU.
    I am not to familiar with wordpress and woocommerce. The direct debit implementation just seems to be old fashioned/wrong if it doesn’t generate a post for each order position!?
    Thank you!

    #1062847
    Brook
    Participant

    Thank you for sharing the link!

    I am not sure if what they’re doing is the “wrong” way or not. Regardless it is still something we’d like to see if we can support. Plenty of WP plugins do things the wrong way after all, and we do our best to be compatible.

    I am logging a ticket for a developer to investigate this. He will download that plugin, and try out a compatibility patch. We will have to do some major tweaking to the concept to make sure it doesn’t break the other Ecommerce platforms like EDD. I am requesting in the ticket for the developer to report back once they have done this – which could take a little while. The thread might autoclose due to inactivity, but the dev can still reopen and report.

    Let me know if you have any questions in the interim.

    Cheers!

    – Brook

    #1078897
    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 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Attendees missing’ is closed to new replies.