Posted: April 3, 2014 at 11:08 am
|
I am using the Custom Template Calendar Table Add-on. When the class is full, the button still says Register and allows users to click on the button and go to a sold out page. I would like to have the Register button be replaced with a “Sold Out” image that the user cannot click. An example page is – http://corkandclick.com/comprehensive-photography-class/ I am using WP 3.8.1 Thanks in advance for your help! |
Hi Ben, The behavior you are describing is the default behavior of the Calendar Table Template. Although by default it would display ‘Closed’. I can see from the site the template has been modified. By default lines 78 – 82 handle this functionality but on your template this may be different: if($open_spots < 1 && $event->allow_overflow == 'N') { $live_button = '<img class="buytix_button" src="'.WP_PLUGIN_URL. "/".plugin_basename(dirname(__FILE__)) .'/closed.png" alt="Closed">'; } else if ($open_spots < 1 && $event->allow_overflow == 'Y'){ $live_button = !empty($event->overflow_event_id) ? '<a href="'.espresso_reg_url($event->overflow_event_id).'"><img class="buytix_button" src="'.WP_PLUGIN_URL. "/".plugin_basename(dirname(__FILE__)) .'/waiting.png" alt="Join Waiting List"></a>' : '<img class="buytix_button" src="'.WP_PLUGIN_URL. "/".plugin_basename(dirname(__FILE__)) .'/closed.png" alt="Closed">'; } |
|
|
Hi Tony thanks for the response. I have updated the PNG file that is used as well as some of the code to hide the class title and display the number of seats. The code that you have called out above is the same that I have, but the “Register” PNG file is still displayed. Ideally it would be better if the classes that are full were not even displayed. Is there a way to update the index.php file to hide events that are full and just not display them? |
Hi Ben, In order to make the full events not display at all you would have to change the main query that’s inside the “Custom Template Display” plugin (not the calendar template plugin) which would involve adding another for attendee numbers against the capacity, and if there are not any seats left, remove those events from the query. That’s something a developer that has experience with writing mySQL queries could take on as a customization project. To help with your original question, I think this is related to a bug in the calendar table template where it’s not correctly checking for open spots that will be fixed in the next version. You can apply the same fix by opening up the index.php file of the calendar template add-on and changing line 68 from: if ( ! has_filter( 'filter_hook_espresso_get_num_available_spaces' ) ){ to if ( has_filter( 'filter_hook_espresso_get_num_available_spaces' ) ){ |
|
The support post ‘Calendar Table Add-on: Change "Register" to "Sold Out" button when class is full’ 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.