How to display a message when the event is full

Although there is no default feature that would enable you to display a message when the event is fully booked, this can be done using template overrides. You can have a look at this article for more information on template overrides.

Template overrides are created by basically copying the file controlling the layout that you wish to change to another location and modifying the copy, leaving the original file intact. This needs to be done in order to make sure that your modifications will not be lost upon future component updates. For now, we will be referring strictly to our scenario.

To display a message when the event is full on the event details page please perform the following steps:

  • Head to \components\com_rseventspro\views\rseventspro\tmpl and copy the show.php file to templates\TEMPLATE_NAME\html\com_rseventspro\rseventspro.

Note that you need to replace TEMPLATE_NAME with the actual name of the template you are using in the frontend. Also, note that you will need to create the com_rseventspro folder if it does not exist under the path specified earlier.

  • Edit the show.php file that was copied to templates\TEMPLATE_NAME\html\com_rseventspro\rseventspro and add the following code where you need to have it displayed in the event details layout:

<h3 style="color:red !important;"><?php if ($full) echo JText::_('COM_RSEVENTSPRO_EVENT_FULL'); 

    else echo JText::_('COM_RSEVENTSPRO_EVENT_NOT_FULL');?></h3>

This code will display Event is full! if the event is fully booked and Event is not full! if there are any tickets left unpurchased. Both messages will be displayed within an <h3> heading, in red. You can adjust the inline style in any way that works best with your website.

  • Let's say that you are using English in your website's frontend. Head to Extensions >> Language Manager >> Overrides, click New to the top-right side of the screen, add COM_RSEVENTSPRO_EVENT_FULL in the Language Constant field and Event is full! in the Text field. Then, click Save.

Repeat the same process for COM_RSEVENTSPRO_EVENT_NOT_FULL and Event is not full!.

If you are using multiple languages on your website, you will need to perform this step for each language.

To display the messages on the event listing page, you will need to use the same code, but the template override will need to be performed for the following file:

\components\com_rseventspro\views\rseventspro\tmpl\default.php.


7 persons found this article helpful.


Was this article helpful?

Yes No
Sorry about that

You Should Also Read

How to display the available tickets information on the event page

How to allow event owners to sell their own tickets

How to remove the time the events occur on from the events listing