Chris

Forum Replies Created

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • in reply to: Displaying remaining stock in related events #1028834
    Chris
    Participant

    Brilliant! sorted with a bit of tweaking, Many thanks.

    Here’s the code in case anyone else needs it:

    
    function tribe_events_count_available_related_tickets( $event = null ) {
    	$count = 0;
    
    	if ( null === ( $event = tribe_events_get_event( $event ) ) ) {
    		return 0;
    	}
    
    	foreach ( Tribe__Events__Tickets__Tickets::get_all_event_tickets( $event->ID ) as $ticket ) {
    		$count += $ticket->stock;
    		$html .= sprintf( '<dt><strong>Places available:</strong></dt><dd>%s</dd>',  $count );
    		$html2 .= sprintf( '<dd><strong>COURSE SOLD OUT</strong></dd>',  $ticket->stock );
    	}
    				
    		if ( $ticket->stock > 0 ) { // if all tickets sold or no tickets
    			echo $html;
    		} if ( $count < 1 ) {
    			echo '<dd><strong>COURSE SOLD OUT</strong></dd>';
    		}
    
    }
    
    
    Chris
    Participant

    Email confirmation example

    • This reply was modified 10 years, 5 months ago by Chris.
    Chris
    Participant

    It’s not the ticket email – it’s the order confirmation email containing order details, payment details and the “course details will be send separately” message.

    in reply to: Edit Email Subject and title #1016479
    Chris
    Participant

    Sorry – just realised this isn’t your plugin!

Viewing 4 posts - 16 through 19 (of 19 total)