Support

Home Forums Event Espresso Premium MAJOR ISSUE. When Event has 1 space left the customer is not taken to Paypal.

MAJOR ISSUE. When Event has 1 space left the customer is not taken to Paypal.

Posted: January 10, 2014 at 1:49 pm

Viewing 18 reply threads


Carlos Flores

January 10, 2014 at 1:49 pm

Hello. I have the latest everything. Event Espresso 3.1.36.2 and WordPress 3.8.

This just started in the last week.

If an event has 1 space left when the customer goes to add the event he is taken to the Confirm and go to payment screen but instead is given the message Thank you!

Your registration is confirmed for Event Name.
A confirmation email has been sent with additional details of your registration.

Also, this the page where it goes wrong:
http://www.sbnewcomers.org/event-registration/?regevent_action=post_multi_attendee

The customer is then not taken to the paypal screen or worst yet is not registered to the event either. Please PLease let me know what to do. Sounds like a major Bug.

Also, this does not happen if the event has more than 2 spaces left.

Thank you in advance.

  • This topic was modified 10 years, 10 months ago by Carlos Flores. Reason: added more info regarding issue


Josh

  • Support Staff

January 10, 2014 at 2:07 pm

Hi Carlos,

Egads! MAJOR ISSUE indeed! Can you post a link where we can try this out so we don’t have to guess. Thanks!


Carlos Flores

January 10, 2014 at 2:24 pm

This a member only website. Can you email me from your eventespresso.com email and I will then send you a account.

My email is carlos@phiwebstudio.com


Josh

  • Support Staff

January 10, 2014 at 2:31 pm

Hi Carlos,

You can send it to support@eventespresso.com


Carlos Flores

January 10, 2014 at 2:41 pm

Ok. I just sent the email. Also here are the events with the issue:

Basically all events with 1 space left are affected.

http://www.sbnewcomers.org/event-registration/?ee=1864

http://www.sbnewcomers.org/event-registration/?ee=1918

http://www.sbnewcomers.org/event-registration/?ee=1908

All Events:
http://www.sbnewcomers.org/all-events/


Josh

  • Support Staff

January 10, 2014 at 4:34 pm

Hi Carlos,

This looks quite a bit different than the default Event Espresso templates. On the single event view where there’s an add to cart link, is that a shortcode being used within a template? If so, is the event_id getting passed as a parameter?

The other thing that could be affecting this is the caching plugin. In order to use WP Super Cache with Event Espresso, the pages that serve registration forms, the cart, and the payment pages need to be set to not be cached. You can add these pages to WP Super Cache’s do not cache this page list. Here’s a screenshot of what this looks like.


Carlos Flores

January 10, 2014 at 5:16 pm

I have the correct cache settings. And the ID is passed correctly. Otherwise other events would not work.

PLus other events are not affected at all. Only events that have 1 space left are the events that the customer cannot register to. Please any other ideas?


Carlos Flores

January 10, 2014 at 5:25 pm

I have the mutiple reg add on. So when I add three events, two events with only 1 space and one event with 10 spaces, when it directs me to paypal, paypal only shows the one event with 10 spaces not the other events.

The problem or issue is in the 1 space left.


Josh

  • Support Staff

January 10, 2014 at 5:34 pm

Carlos,

What is the code that you’re using in the template that displays the single event that generates the add to cart link?


Carlos Flores

January 10, 2014 at 7:34 pm

Ok. Sure.
This is in the Event_List_Display.php

if ($cart_link){
?>
<span class=”viewevent”>
<?php
echo isset($cart_link) && $externalURL == ” ? $cart_link : ”;
?>
</span>
<?php
}

And this in the Registration_page_display.php
<span class=”viewevent”>
<? echo do_shortcode(‘[ESPRESSO_CART_LINK event_id=”‘.$event_id.'” direct_to_cart=1 moving_to_cart=”Redirecting to cart…”]
‘);
?></span>

Hope that helps. Thanks again for looking into this. What is odd is that this just started to happen. Last month there were no issues. Maybe it was last update?


Josh

  • Support Staff

January 10, 2014 at 8:33 pm

Hi Carlos,

The last update from version 3.36.1 to 3.36.2 did not affect the add attendees to database functionality. It was a very minor update that added two things:

1) An option was added to Event Espresso>General Settings that affects a promo code setting in the event editor.

2) A script that handles the return from the payment gateway after payment was adjusted to account for if there is a free event added to the cart.

Where there could be a potential cause is if any functions from cart.php or add_attendees_to_db.php were customized based on the functions from Event Espresso version 3.1.35 or earlier and copied to a custom functions file. There were some code changes going from .35 to .36 that dealt with preventing overbooking of an event. Can you check to see if there are any custom functions that override core functions that handle the registration process? Custom functions can run from the theme’s functions.php file, a custom snippets plugin, or from /wp-content/uploads/espresso/custom_functions.php.

I have tried testing this out a few different ways on a test server running a stock 3.1.36.2 install of Event Espresso and I haven’t been able to reproduce this, so any information you can give on what functions if any have been customized may help narrow down the issue.


Carlos Flores

January 11, 2014 at 3:44 pm

I have no custom functions.

I too have installed the latest on a stage server and cannot duplicate the issue. So it must be in my custom template.

Thank you very much for looking into it and I am sorry that at the end of the day it is most likely my doing. I will post later what the issue was in my custom template to help others who have modified their template and have the same issue.

Thank you Josh and the Event Espresso Team.


Josh

  • Support Staff

January 13, 2014 at 11:04 am

Hi Carlos,

If you can post the contents of your custom template in a pastebin and link to it here we’ll be glad to take a look to see if we can spot something missing or a potential cause. 🙂


Carlos Flores

January 13, 2014 at 2:13 pm

PLEASE Help.

I have a clean install and not using any custom functions.

I have found the issue.

When 1 space left and you click add to cart instead of clicking register you get the error and event espresso does not register you for the event.

I have replicated this with a clean install. PLease try with your system. Create an event, have the event 10 spaces, then fill 9 spaces. Then go back try to register for the last space by clicking add to cart instead of register and you will see the issue. Please Help.


Sidney Harrell

January 13, 2014 at 2:26 pm

I set this up on my test server, and it looks like it goes through to the payment page, and then I get this message:

Sorry, you have requested 2 ticket(s) for ‘Event #7’, but only 1 remains(s). All other tickets for this event have been sold, or are being purchased. You may want to try registering later, in case someone doesn’t finish registering or cancels

Is that the same issue you are seeing?


Carlos Flores

January 13, 2014 at 2:33 pm

No. What I get it that the event is confirmed. But the user never gets and email confirmation and system does not register the person. This happens with a free or paid event that only has one space.

If the event has 2 spaces and you register both then the system works fine. Again this only happens when 1 space is available and you click the add to cart button instead register.

Also, this is the message I get:

Thank you! Your registration is confirmed for 1 Santa Barbara Newcomers Club events

A confirmation email has been sent with additional details of your registration.

This has to be an issue with the Multiple Registration Add on.

Please any direction or help would be greatly appreciated.


Sidney Harrell

January 13, 2014 at 4:41 pm

Sorry, I was testing with an Alpha copy of 3.1.37. When I switched to the current version and retested, I got the same results as you. We’ve worked out a solution that appears to be working. It requires changes to 2 files:
1: includes/functions/cart.php, starting at line 195 should be changed to:

$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.
2: includes/process-registration/add_attendees_to_db.php, starting at line 713:

$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, I just put it in to give you 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.


Carlos Flores

January 13, 2014 at 5:15 pm

Awesome. So far so good. I will let you know if there are any other bugs.

Thank you fixing. I was losing hope. Glad it works for now.


Dean

January 14, 2014 at 4:07 am

Hi Carlos,

I will mark this thread as resolved. If any further issues arise, please start a new thread and link back to this one. Thanks.

Viewing 18 reply threads

The support post ‘MAJOR ISSUE. When Event has 1 space left the customer is not taken to Paypal.’ 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