Posted: January 6, 2014 at 8:28 am
|
Hi We’ve discovered that there appears to be an issue with event limits. If the event capacity is set to 50, the system will accept bookings up to 49 but any more won’t register in the system but will allow people to book from the front end. Is this something you’ve experienced before? |
Hi Mark, I haven’t. Which version of Event Espresso is installed, and can you post a link to the event in question so we can take a look? |
|
|
Hi Josh It’s version 3.1.36.1.P, link to the event here: http://events.psnc.org.uk/event-registration/?ee=6 Many thanks |
|
Hi, Did the attendees get registered from the front end or were they added in the admin area (manually or via import)? |
|
Hi Dean From the front end Mark |
|
Thank you and is the event you linked earlier in the thread currently full? |
|
No, it is maximum capacity -1 When any event is maximum capacity -1, it will still allow you to register on the front end but it won’t add any more registrants on the back end |
|
It seems to get stuck at “maximum -1”. eg if capacity was 30, it will register up to 29 and then stop collecting data although the front end still allows registrations. |
Hi Mark, Where are you setting the maximum capacity to -1? |
|
|
Sorry, to be clear, I’m not setting the maximum capacity to -1, I was merely trying to represent that the system fails one delegate below maximum capacity so if the maximum is 30, it fails at 29. If capacity is 200, it fails at 299. If maximum capacity is ‘x’, then the system fails at x-1 |
|
[amendment] |
Hi Mark, I checked the source code on the page that you linked to and it looks like there are quite a few of the Event Espresso templates that have been moved to /wp-content/uploads/espresso/templates. That may be causing the issue. Have you tried this with the stock Event Espresso templates? |
|
|
I had coped the EE templates over to the wp-uploads folder but had made no changes except adding
At the bottom of the page as the client wanted to move the ‘add to cart’ button to the bottom. I have just tried using the stock templates with no ‘add to basket’ button (selecting “yes” for “display registration form”) and it all appears to work ok. However, if I select “no” for display registration form and add the shortcode for add to cart as described here https://eventespresso.com/wiki/multiple-events-registration-use-add-to-cart-link-instead-of-default-registration-form/ the bug reappears. So we’ve narrowed down the issue but any ideas how to fix it? Cheers |
Hi Mark, When you place an add to cart shortcode in a do_shortcode in a template it needs to have the event ID in order to work. When the add to cart shortcode is in the event’s description, Event Espresso knows it’s for that event, but it doesn’t if it’s within the template. Can you try changing your template code to: <?php echo do_shortcode('[ESPRESSO_CART_LINK event_id="'.$event_id.'" anchor="Add to Cart"]'); ?> So that it includes the event’s ID? This might help. |
|
|
Sorry Josh, no joy |
Mark, Can you check the PHP error log for any errors when you try registering for that last spot? |
|
|
Hi Josh No errors showing I’m afraid. This same bug seems to happen on your test install here as well https://eventespresso.com/testdrive/wp-admin/admin.php?page=events&action=edit&event_id=22288 Mark |
Hi Mark, We’ve worked out a solution that appears to be working. It requires changes to 2 files: $attendee_quantity = 0; if ( isset( $_POST['price_id'][$event_id] )) { $price_id = $_POST['price_id'][$event_id]; } else { return FALSE; } if (is_array($price_id)) { foreach ($price_id as $_price_id => $val) { //assign the event type and the quantity $attendee_quantity += $updated_events_in_session[$event_id]['price_id'][$_price_id]['attendee_quantity'] = esc_sql($val); $updated_events_in_session[$event_id]['price_id'][$_price_id]['price_type'] = $events_in_session[$event_id]['price_id'][$_price_id]['price_type']; } } else if ( $price_id !== FALSE ) { Note that line 195 and 206 are changed, and what was line 209 is deleted. $return_data = event_espresso_add_attendees_to_db( $event_id, $session_vars, TRUE ); if (!empty($return_data['registration_id'])) $session_vars['data']['attendee_quantity']--; That second line is a new line of code. The first line is unchanged, it’s there as a reference as to where to put the second line. We’ll be testing this to try to get a hotfix release out to address the issue (3.1.36.3), so any feedback you can provide from testing these changes on your end would be helpful. If you have trouble applying the changes, let us know by filling out the form here (be sure to include ftp credentials), and we can apply them for you. |
|
The support post ‘Attendee limit bug’ 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.