Support

Home Forums Event Espresso Premium EE4 if ticket max value not set then the value is infinite

EE4 if ticket max value not set then the value is infinite

Posted: April 28, 2015 at 4:21 pm

Viewing 1 reply thread


Caitlyn Fagan

April 28, 2015 at 4:21 pm

I just wanted to report a bug that I ran into within the ticket_selector_chart.template.php. If you do not have a max value set on a ticket it then has an infinite loop.

<!– // offer ticket quantities from the min to the max –>
<?php $i= 0; for ( $i = $min; $i <= $max; $i++): ?>
<option value=”<?php echo $i; ?>”> <?php echo $i; ?> </option>
<?php endfor; ?>

Just wanted to give you a heads up.


Lorenzo Orlando Caum

  • Support Staff

April 29, 2015 at 6:09 am

Hi, thanks for sharing. I asked a team member to check in this and we have this coding that helps with that:

// offer the number of $tickets_remaining or $max_atndz, whichever is smaller
$max = min( $remaining, $max_atndz );
// but… we also want to restrict the number of tickets by the ticket max setting,
// however, the max still can’t be higher than what was just set above
$max = $ticket->max() > 0 ? min( $ticket->max(), $max ) : $max;
// and we also want to restrict the minimum number of tickets by the ticket min setting
$min = $ticket->min() > 0 ? $ticket->min() : 0;
// and if the ticket is required, then make sure that min qty is at least 1
$min = $ticket->required() ? max( $min, 1 ) : $min;

It may appear as infinite but it will end up being the maximum number of tickets remaining.


Lorenzo

Viewing 1 reply thread

The support post ‘EE4 if ticket max value not set then the value is infinite’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso