Support

Home Forums Event Espresso Premium Add price and number of available tickets to Table Event Add-On

Add price and number of available tickets to Table Event Add-On

Posted: July 10, 2018 at 2:26 pm


whataboutchris

July 10, 2018 at 2:26 pm

Hey all! I tried adding the price to the Table Event Add-On. The prices were added, BUT… the dates now appear outside of the table.

I tried to follow: https://gist.github.com/lorenzocaum/ef6afefd07c9c5f6f681

…but it seems some things are a bit different now.

I’m not a PHP guy, but know HTML/CSS.

I would also like to add an additional column to show how many tickets are available for each event.

See here: http://soccerlearningcenter.com/justforkicks/class-registration/


whataboutchris

July 10, 2018 at 2:29 pm

Here’s a link to my PHP file: https://res.cloudinary.com/crownheights/raw/upload/v1531254710/TSLC/espresso-events-table-template.template.php


Josh

  • Support Staff

July 10, 2018 at 2:58 pm

Hi, I checked the PHP file and it looks like it’s missing an opening <td> tag on line 164.

So this:

<td class="starting_from_pricing event-<?php echo $post->ID; ?>"><?php echo $ticket_price; ?></td>
	<ul class="ee-table-view-datetime-list">

should be changed to:

<td class="starting_from_pricing event-<?php echo $post->ID; ?>"><?php echo $ticket_price; ?></td>
<td>
	<ul class="ee-table-view-datetime-list">


whataboutchris

July 10, 2018 at 3:13 pm

Perfect! Thanks!

What about adding an additional column to show how many tickets are available for each event?

http://soccerlearningcenter.com/justforkicks/class-registration/


Josh

  • Support Staff

July 10, 2018 at 3:35 pm

It looks like you’ve got the add another column part squared away. So after you add one more column, the PHP code to display number of available tickets, in its simplest form, is:

<?php echo $event->spaces_remaining_for_sale(); ?>

but you might want to wrap the above in a check so nothing is displayed if the event is sold out:

<?php if ( ! $event->is_sold_out() ) {
  echo $event->spaces_remaining_for_sale();
} ?>


whataboutchris

July 11, 2018 at 9:47 pm

Perfect! I figured it out. Thank you.

The support post ‘Add price and number of available tickets to Table Event Add-On’ 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