When you set up multiple RSVPs for an event, the order in which they appear on the front end is random and can be different every time the page is loaded.

💡 Note: With the Block Editor, it is NOT possible to create or edit multiple RSVPs for an event. As a workaround, you can create the RSVPs with the Classic Editor and then switch over.

The following snippet/template override introduces the option to sort the RSVP blocks based on two selected properties.

1. Create the override

You can either create a file here wp-content/themes/[your-theme]/tribe/tickets/v2/rsvp.php and copy the code into the file, or download it from the repository below and place it in the above folder.

https://gist.github.com/andrasguseo/f02b261b7d84b6c882dab89eb90dcf7f

2. Customize the sorting

You can customize the sorting of the RSVP blocks around line 60, which looks like this:

$property1 = 'ID';
$order1    = 'ASC';
$property2 = null;
$order2    = 'ASC';

You can use the following property values for sorting:

  • ID – The post ID of the RSVP/ticket. This will sort them by creation time.
  • name – The name/title of the RSVP/ticket
  • stock – The current available stock of the RSVP/ticket
  • capacity – The total capacity of the RSVP/ticket
  • start_date – The sale start date of the RSVP/ticket
  • start_time – The sale start time of the RSVP/ticket
  • end_date – The sale end date of the RSVP/ticket
  • end_time – The sale end time of the RSVP/ticket
  • sku – The SKU name of the RSVP/ticket

If you only want to sort by one parameter, then you can set $property2 = null; as you can see in the example above.

Examples

The lowest available places first, then RSVP name

Shows RSVPs with the fewest places left first.

$property1 = 'stock';
$order1    = 'ASC';
$property2 = 'name';
$order2    = 'ASC';

The RSVPs that will become unavailable first

This can be useful when promoting RSVPs that go off sale soon.

$property1 = 'end_date';
$order1    = 'ASC';
$property2 = null;
$order2    = 'ASC';

The order RSVPs were created in

If you want them to stay in the same order all the time.

$property1 = 'ID';
$order1    = 'ASC';
$property2 = null;
$order2    = 'ASC';