• Resolved lukemv

    (@lukemv)


    Is there anyway to add a threshold to tickets (or event level) that will hide the number of tickets available until it reaches a certain level? For example, rather than showing “500 available” I’d like to hide this (or change the # to a generic term like “Tickets still available” until it reaches a lower limit, ie: “Only 14 available.”

    I feel like I’ve seen this in the past, but was hoping it would be a fully integrated option.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hey @lukemv ,

    Thanks for reaching out.

    Please go to Events > Settings > Ticket Settings and enter the threshold ticket number in the Display # tickets left threshold field as shown: https://share.getcloudapp.com/p9uZ506v

    Let me know if that works.

    Best,
    Deekshith

    Thread Starter lukemv

    (@lukemv)

    Thanks for the response. So, I use the premium ticket plugin but not the events plugin. Wouldn’t it make sense to have ticket thresholds be affiliated with the ticket plugin rather than the event plugin?

    Hey @lukemv ,

    I’m sorry, it is actually?Tickets > Settings > Ticket Settings, and then enter the threshold ticket number in the?Display # tickets left threshold?field as shown:?https://share.getcloudapp.com/p9uZ506v

    Let me know if that works.

    Best,
    Deekshith

    Plugin Support Darian

    (@d0153)

    Hi @lukemv

    I hope you’re doing well. I just wanted to touch base and check in with you. It’s been a little while since we’ve heard from you. I was just curious if you had the chance to try out the recommendation provided above.

    Let me know if there’s anything I can assist you with.

    Plugin Support Darian

    (@d0153)

    Hi @lukemv

    It appears that there hasn’t been any recent activity on this thread, so we’ll consider it resolved. However, if you have any additional questions or concerns, feel free to start a new thread.

    Hi @lukemv

    You can improve the display with some custom coding by modifying this template: wp-content/plugins/event-tickets/src/views/v2/tickets/item/extra/available/quantity.php

    To do so copy it to [your-theme]/tribe/tickets/v2/tickets/item/extra/available/quantity.php and apply the modifications you need

    My code right now looks like this, i made it so that instead of showing the number of tickets left, it shows “High”, “Medium” or “Low” availability until it reaches the threshold, then it switches to # of tickets left (this is just plain, it requires some more coding in css for styling)

    $capacita = tribe_tickets_get_capacity( $ticket ); 
    $threshold_media = 0.8*$capacita;
    $threshold_bassa = 0.5*$capacita;
    
    
    if (
    	( 0 !== $threshold && $threshold < $available_count )
    	|| $is_unlimited
    ) {
    	if ($available_count > $threshold_media) {
    	echo wp_kses_post(
    	sprintf(
    	// Translators: 1: opening span. 2: the number of remaining tickets to buy. 3: Closing span.
    		_x(
    			'Disponibilità: <span class="disponibilealta">Alta</span>',
    			'Tickets available',
    			'event-tickets'
    		),
    	)
    );
    return;
    }
    
    if ( $available_count > $threshold_bassa ) {
    echo wp_kses_post(
    	sprintf(
    	// Translators: 1: opening span. 2: the number of remaining tickets to buy. 3: Closing span.
    		_x(
    			'Disponibilità: <span class="disponibilemedia">Media</span>',
    			'Tickets available',
    			'event-tickets'
    		),
    	)
    );
    return;
    }
    
    if ( $available_count < $threshold_bassa || $available_count == $threshold_bassa ) {
    echo wp_kses_post(
    	sprintf(
    	// Translators: 1: opening span. 2: the number of remaining tickets to buy. 3: Closing span.
    		_x(
    			'Disponibilità: <span class="disponibilebassa">Bassa</span>',
    			'Tickets available',
    			'event-tickets'
    		),
    	)
    );
    }
    return;
    }
    
    if ($available_count == 0) {
    echo wp_kses_post(
    	sprintf(
    	// Translators: 1: opening span. 2: the number of remaining tickets to buy. 3: Closing span.
    		_x(
    			'%1$s %2$s %3$s disponibili',
    			'Tickets available',
    			'event-tickets'
    		),
            '<span class="tribe-tickets__tickets-item-extra-available-quantity">',
    		$available_count,
    		'</span>'
    	)
    );
    return;}
    
    
    
    echo wp_kses_post(
    	sprintf(
    	// Translators: 1: opening span. 2: the number of remaining tickets to buy. 3: Closing span.
    		_x(
    			'<span class="testodisponibilita">Disponibilità: </span><span class="personalizzadisponibili">%1$s %2$s %3$s disponibili</span>',
    			'Tickets available',
    			'event-tickets'
    		),
            '<span class="tribe-tickets__tickets-item-extra-available-quantity personalizzanumerodisponibili">',
    		$available_count,
    		'</span>'
    	)
    );

    hope it helped ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Hide Number of Tickets Available’ is closed to new replies.