Johannes

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: WooCommerce Catalog Visibility #1279246
    Johannes
    Participant

    Thank you!

    Yes, it took care of the catalog visibility. However, it still would be
    nice if new tickets are automatically marked as non taxable. But, I have it
    set it with a little code snippet. So, no need to change it for me.

    Johannes

    —————————————————————————-

    • This reply was modified 8 years, 11 months ago by Johannes.
    • This reply was modified 8 years, 11 months ago by Johannes.
    in reply to: WooCommerce Catalog Visibility #1272696
    Johannes
    Participant

    That worked. Thank you!

    in reply to: Get posts with tickets #1272600
    Johannes
    Participant

    Thank you!
    I ended up using something like this:

    function get_events_with_registration() {
    	$cache = tribe( 'tickets.cache' );
    	$cache->include_past( false );
    	$event_ids = $cache->posts_with_ticket_types( array( 'twt_event' ), true);
    	if(empty($event_ids)) {
    		return false;
    	}
    	$events = array();
    	foreach($event_ids as $event_id) {
    		$event = get_post($event_id);
    		if(tribe_events_has_soldout($event)) {
    			continue;
    		}
    
            //check if in date range
    		$tickets_available = false;
    		foreach ( Tribe__Tickets__Tickets::get_all_event_tickets( $event ) as $ticket ) {
    			if(tribe_events_ticket_is_on_sale($ticket)) {
    				$tickets_available = true;
    				break;
    			}
    		}
    
    		if($tickets_available) {
    			$events[] = $event;
    		}
    	}
    	if(empty($events)) {
    	    return false;
    	}
    	return $events;
    }
    in reply to: WooCommerce Catalog Visibility #1272598
    Johannes
    Participant

    Thank you for checking into it. Unfortunately, the snippet did not work. WooCommerce must keep track differently of the visibility option. I think they moved it to a taxonomy but I am not sure. (I know your hook works though since I use other actions in it). However, since this is not an urgent issue, I will wait for the fix.

    Thanks again.

Viewing 4 posts - 1 through 4 (of 4 total)