You’re trying to use a variable that’s not set. In this case the variable is $event_id. If you look at the code in the shopping_cart.php template around line 60, you’ll see that there’s already a variable set for $available_spaces, so why not use that instead?
Assuming you have an $event_id variable setup but you’ll like want to use $r->id for the event id.
However within shopping_cart.php on line 60-62 you should have:
$num_attendees = apply_filters('filter_hook_espresso_get_num_attendees', $r->id);//Get the number of attendees
$available_spaces = apply_filters('filter_hook_espresso_available_spaces_text', $r->id);//Gets a count of the available spaces
$number_available_spaces = apply_filters('filter_hook_espresso_get_num_available_spaces', $r->id);//Gets the number of available spaces
That does all of this for you so you have those 3 variables you can echo out to get the value you’re looking for.
Available Spaces:
You don’t need the double quotes around the values unless there is a space, those can often cause problems. It could be the forum adding this formatting but there are multiple styles of quote within your text ‘, ', ” that you need to watch out for.
The support post ‘Show available spaces in cart’ 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.