Support

Home Forums Event Espresso Premium Cant go back to registration at checkout and wrong #id in URL

Cant go back to registration at checkout and wrong #id in URL

Posted: December 3, 2024 at 7:30 am

Viewing 6 reply threads


Gorkem

December 3, 2024 at 7:30 am

Hi,
We’ve had our attention drawn to a couple of issues on the checkout process that i am unable to find a solution to, so I’m really hoping you guys can help.

We are using Stripe for our payments.

When a user proceeds to fill out the event registration form, it goes to a URL along the lines of: mysiteurl.com/registration-checkout?uts=1733235435#checkout

Initially that doesn’t seem to be a problem but once the user has filled out the form and they click to proceed to payment, the form refreshes and the anchor ID would return them to the top so they can see what is going on. However it doesn’t and after inspecting the html, there is actually no html element on the page with the id of checkout. So what happens is the payment form refreshes above them out of the top of the screen and they have to scroll up to see it and fill it out.

The closest (and probably most relevant) ID i can find is ee-single-page-checkout-dv

Is there a way to modify things so the registration URL ends with #ee-single-page-checkout-dv instead of #checkout? I’d guess this needs modifying in the modal popup when you click to buy as well as in the cart screen (which also has a button to proceed to registration that has the same URL in it).

And then the other issue is, once the user has filled out the Registration Form and gone to the payment stage, they can never go back to the registration stage (in case they want to update something on there). There is no button to go back and seemingly no way to return them there. Surely there is a way to allow them to go back and change things before they have paid?


Tony

  • Support Staff

December 10, 2024 at 3:40 pm

Hi there,

However it doesn’t and after inspecting the html, there is actually no html element on the page with the id of checkout.

So the issue here is more that, at this point… there should be.

Changing the anchor to something else is indeed possible (although you’ll need to jump through a few hoops to get them all), but…. if the #checkout element isn’t loading on the page its an indication of other problems so I would advise figuring out why rather than patching EE to use another anchor.

The code used to load the checkout element runs on the loop_start hook:

add_action('loop_start', [$this, 'set_checkout_anchor'], 1);

So if its not loading on the page, is the theme doing something unexpected to load the page?

Are you running your own custom theme? If so does it follow the WP theme standards?

Can you link me to an event I can take a look at to view this?

And then the other issue is, once the user has filled out the Registration Form and gone to the payment stage, they can never go back to the registration stage (in case they want to update something on there). There is no button to go back and seemingly no way to return them there. Surely there is a way to allow them to go back and change things before they have paid?

I assume you have the Multi Event Registration add-on enabled based on your post? Currently we don’t hae an option to go back to the attendee information step once they proceed to payment unless the ticket selection is changed.

Althught, the user does have the option to change the attendee information after registrations is complete.


Gorkem

December 11, 2024 at 7:46 am

Hi Tony,

It is indeed a custom theme but it isn’t doing anythign weird in that regard.
So the page that outputs the checkout stuff is page-registration-checkout.php and it is using <?php echo do_shortcode(‘[ESPRESSO_CHECKOUT]’); ?>

Within the area that is populated by that shortcode, there is no id=”checkout”, either on the first stage (registration) or the second (payment).

<div id=”ee-single-page-checkout-dv”> is the wrapper element the shortcode is adding to the page.

Certainly! If you go here:
https://www.pmt.education/courses/bookings/gcse/science/christmas-online/
Click Book Now or scroll down to the ticket selector, set your quantity, click book now and then proceed to registration you’ll be at the point where the id ee-single-page-checkout-dv wraps everything but a “checkout” id doesn’t exist (but is in the URL).

As far as not being able to go back, that’s a shame! Is that something planned for the future at all? It seems like a strange thing to lock people out of just for clicking proceed as they havent altered anything or paid at that point.


Tony

  • Support Staff

December 11, 2024 at 8:02 am

Ok, so you have this:

It is indeed a custom theme but it isn’t doing anythign weird in that regard.

And then…

So the page that outputs the checkout stuff is page-registration-checkout.php and it is using

Whilst not ‘weird’, why are you processing the shortcode via the template using do_shortcode()?

Does the_loop run on that output? loop_start runs as the beginning of the loop… no loop (or the loop running outside of the expected location) means no loop_start hook to add the code.

Within the area that is populated by that shortcode, there is no id=”checkout”, either on the first stage (registration) or the second (payment).

This makes sense with the context given so far.

Are you not running the_loop?

As far as not being able to go back, that’s a shame! Is that something planned for the future at all? It seems like a strange thing to lock people out of just for clicking proceed as they havent altered anything or paid at that point.

It’s not that we are intentionally locking people out, the attendee progressed through the checkout steps and made it to payment options. With Multi Event Registration enabled, we keep the session open so navigating away from the page doesn’t change the session’s ‘completed steps’, meaning when you go back to SPCO, it knows your current step is ‘payment_options’ and loads that.

We have discussed this previously and do have a feature request ticket to add the ability to go back to attendee info. However, it has had a relatively low number of requests from users, so it isn’t considered a priority feature at this time.


Gorkem

December 11, 2024 at 8:28 am

Hi Tony,

AHA! I see what you mean. It was initially done this way (NOT using the loop) because i was trying to customise the layout as much as possible with regards to nesting and so on for the specific page, and so i used the shortcode.

But you’re right (of course!) if i remove the shortcode and replace it with the loop, i suddenly now get:
<a id="checkout" style="float: left; margin-left: -999em;"></a>

Honestly it has been a long while since i built this so I’m not sure why i ended up at the shortcode implimentation, but switching it for the standard WP loop seems to fix this. Thank you!

As far as the ability to go back is concerned, that’s fair enough. Well, consider my voice to be behind the “add this feature when you can” collective :^)


Gorkem

December 11, 2024 at 8:42 am

“But you’re right (of course!) if i remove the shortcode and replace it with the loop, i suddenly now get:”

I just reaslised my post ommitted the html!
Basically i get the anchor element with the class of checkout now. I’ve set this al live and it seems to be doing the trick.


Tony

  • Support Staff

December 11, 2024 at 12:30 pm

🙂 The forum strips out tags for users, admins can view them so I’ve fixed that for you.

Honestly it has been a long while since i built this so I’m not sure why i ended up at the shortcode implimentation, but switching it for the standard WP loop seems to fix this. Thank you!

No problem at all, glad you got it working 🙂

As far as the ability to go back is concerned, that’s fair enough. Well, consider my voice to be behind the “add this feature when you can” collective :^)

Noted 🙂

Viewing 6 reply threads

The support post ‘Cant go back to registration at checkout and wrong #id in URL’ 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