Support

Home Forums Custom Files Add-on (EE3) Spaces available counter

Spaces available counter

Posted: January 25, 2013 at 4:55 am


john davies

January 25, 2013 at 4:55 am

Morning all, I am looking for a way to show what spaces are still available on courses using the event espresso table. Any suggestions? example page on my site Any help would be much appreciated. many thanks John

  • This topic was modified 11 years, 2 months ago by  Josh. Reason: not a translation question


Josh

  • Support Staff

January 25, 2013 at 4:09 pm

Hi John,

I’d recommend using the [ATTENDEE_NUMBERS] shortcode for this:

https://eventespresso.com/wiki/shortcodes-template-variables/#attendee-numbers

Depending on where you want the counter to show up, it can be used on a page like this:

[ATTENDEE_NUMBERS event_id=1 type= available_spaces]

or within template code like this:

<?php echo do_shortcode('[ATTENDEE_NUMBERS event_id="'.$event_id.'" type="available_spaces"]');?>


john davies

February 6, 2013 at 2:52 pm

Unfortunately this only shows a zero.


Josh

  • Support Staff

February 8, 2013 at 1:00 pm

Hi John,

Which version of Event Espresso are you using, and which template file are you customizing?


john davies

February 10, 2013 at 4:44 am

I am currently on the latest version, 3.1.30.5.P and trying to modify the custom files template espresso_table.php

Ideally I would like to show tickets left/max tickets

I am using this code

/

it currently shows 0/ <—Blank

Any ideas?


john davies

February 10, 2013 at 4:44 am

 / 


john davies

February 10, 2013 at 4:45 am

 / 


john davies

February 10, 2013 at 4:46 am

 / 


john davies

February 10, 2013 at 4:47 am

Crying out loud ! your code button doesn’t work either!!!!1
Try this http://pastebin.com/ydCswQ6S


Josh

  • Support Staff

February 11, 2013 at 7:59 pm

Hi John,

I’m not sure why you were having trouble with posting the code. Sorry about that.

So here’s the code:

 / 

The $event_id variable isn’t declared as such in espresso_table.php. You can use $event-&gt;id though. So I’d change the code to read as:

id.'" type="num_attendees"]');?&gt; / id.'" type="reg_limit"]');?&gt;

Seth is actually going through some of those custom files templates and updating them to use some of the newer Event Espresso functions and variables.


Josh

  • Support Staff

February 11, 2013 at 8:04 pm

Wow. That serves me right for copying and pasting that code from pastebin. Here’s a second crack:

<?php echo do_shortcode('[ATTENDEE_NUMBERS event_id="'.$event->id.'" type="num_attendees"]');?>
 / 
<?php echo do_shortcode('[ATTENDEE_NUMBERS event_id="'.$event->id.'" type="reg_limit"]');?>

Make sure you remove that ! in just before the second echo statement.


john davies

February 13, 2013 at 3:37 am

Thank you that worked.

The support post ‘Spaces available counter’ 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