Posted: August 8, 2014 at 6:42 am
|
hey! I’ve a problem with the events-table: here the button should say “sold out” but doesn’t: http://www.alexander-mueller.at/amfweb/kursliste/ (it’s the course on 5. september) here it works like it should: http://www.alexander-mueller.at/amfweb/calendar/ do you have a solution for my problem? I’m currently running Event Espresso – 3.1.36.5.P Version 3.9.2 and don’t want to update because of some changes to the core files! thanks a lot! |
Hi Alexander, Please see Dean’s sample code here: https://eventespresso.com/topic/displaying-sold-out-on-custom-table-layout/#post-39550 — |
|
|
hey! unfortunately it’s not that easy. Firstly, I don’t have the espresso_tables.php – secondly I’ve modified my tables as you can see in the provided link. Is it maybe just the code-snippet that controls the way it interacts with the open spots, that I can paste into events-table/Index.php? I’m a little confused 🙂 thanks! |
Hi Alexander, The Custom Template Add-on (which you are using with a customised template) already contains code to handle Sold Out events. On the original template this would be lines 47-51 if ( ! has_filter( 'filter_hook_espresso_get_num_available_spaces' ) ){ $open_spots = apply_filters('filter_hook_espresso_get_num_available_spaces', $event->id); //Available in 3.1.37 }else{ $open_spots = get_number_of_attendees_reg_limit($event->id, 'number_available_spaces'); } Then lines 80-86 if($open_spots < 1 && $event->allow_overflow == 'N') { $live_button = __('Sold Out', 'event_espresso'); $cart_link = ''; } 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).'">'.__('Join Waiting List', 'event_espresso').'' : __('Sold Out', 'event_espresso'); $cart_link = ''; } As you have modified your template you’ll need to see why your template is not using the code already provided to display Sold Out events. |
|
|
hi tony! I’m not using a custom template – it’s the normal espresso-table template that’s included! I’ve just modified the ‘espresso-tables/Index.php’ regarding the tableheaders and added the start and endtime of the events! take a look at http://www.alexander-mueller.at/amfweb/kursliste/ – you see the third one is sold out, but the button still says “Buchen” (“Book now” in german!). I have exactly this code you’ve posted in this template and did not change it! As you can see in the event-calender view, if you hover on an events, it works correctly: It says “Sold out!” only in the table-view the problem happens! br, |
On Line 47 you’ll have: if ( ! has_filter( 'filter_hook_espresso_get_num_available_spaces' ) ){ Remove the ! from that statement. if ( has_filter( 'filter_hook_espresso_get_num_available_spaces' ) ){ That should then work as expected. |
|
|
tony, you’re the best! |
No Problem 🙂 I’ll mark this thread resolved, if you have any further questions please feel free to open up another thread. |
|
The support post ‘Sold Out not showing in events-table’ 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.