Home Forums Event Espresso Premium Use of undefined constant ticket

Use of undefined constant ticket

Posted: September 12, 2018 at 3:29 pm

Mana Retreat

September 12, 2018 at 3:29 pm

Just completed normal update of EE4 and now get this error message and our event table no longer displays. – Page URL in question –
Error thrown
[] operator not supported for strings.

[12-Sep-2018 21:13:08 UTC] PHP Warning: Use of undefined constant ticket – assumed ‘ticket’ (this will throw an Error in a future version of PHP) in /home/manaret1/public_html/wp-content/uploads/espresso/templates/ticket_selector_chart.template.php on line 445

Any help would be much appreciated.


  • Support Staff

September 12, 2018 at 3:33 pm


The PHP warning is actually originating from the custom code located in your site’s uploads folder. May I ask what’s the contents of that file on and around line 445?

Mana Retreat

September 12, 2018 at 3:56 pm

Hi Josh
Thank you for your prompt reply.

The specific line at 445 is:<?php endif; ticket //end template_settings->show_ticket_details check?>

Ticket selector table display do actions.


  • Support Staff

September 12, 2018 at 4:00 pm

That does not look like valid PHP code, maybe something got rearranged there by mistake while editing?

In any case, it looks like that should be changed to:
<?php endif; ?>

Mana Retreat

September 12, 2018 at 4:35 pm

Have changed the line of code as suggested above but still get error on page and ticketing chart dosen’t display.
This file hasn’t been changed or edited since installation and previously worked.
We did update our php to version 7.2 if that is relevant.
I’m happy to send ftp details if useful.

Mana Retreat

September 12, 2018 at 5:44 pm

Regarding the error msg on the page:[] operator not supported for strings
I found several instances of [] as per code snippet from the ticket_selector_chart.template.php file.

					<select name="tkt-slctr-qty-<?php echo $EVT_ID; ?>[]" id="ticket-selector-tbl-qty-slct-<?php echo $EVT_ID . '-' . $row; ?>" class="ticket-selector-tbl-qty-slct" title="">
						// this ensures that non-required tickets with non-zero MIN QTYs don't HAVE to be purchased
						if ( ! $ticket->required() && $min !== 0 ) {
						<option value="0">&nbsp;0&nbsp;</option>
					<?php }
						// offer ticket quantities from the min to the max
						for ( $i = $min; $i <= $max; $i++) {
						<option value="<?php echo $i; ?>">&nbsp;<?php echo $i; ?>&nbsp;</option>
					<?php } ?>
						$hidden_input_qty = FALSE;

					// depending on group reg we need to change the format for qty
					if ( $hidden_input_qty ) {
					<input type="hidden" name="tkt-slctr-qty-<?php echo $EVT_ID; ?>[]" value="0" />
						<input type="hidden" name="tkt-slctr-ticket-id-<?php echo $EVT_ID; ?>[]" value="<?php echo $TKT_ID; ?>" />

Mana Retreat

September 12, 2018 at 5:53 pm

Hi Josh
I reverted our PHP version back to V:7.0 from 7.2 and all works again.
Many thanks for your support.
Kind regards Stephen


  • Support Staff

September 12, 2018 at 6:18 pm

The code snippet didn’t appear to have anything related to the error, message, but in any case it will best if your developer can update the custom code so it’s ready for PHP 7.2.

The support post ‘Use of undefined constant ticket’ 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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3 Documentation for Event Espresso 4

Status: closed

Updated by  Josh 1 year, 8 months ago ago

Topic Tags


This topic is: not resolved
Do NOT follow this link or you will be banned from the site!