Support

Home Forums Event Espresso Premium Is there an action hook on the Proceed to Registration button?

Is there an action hook on the Proceed to Registration button?

Posted: March 15, 2016 at 6:14 am

Viewing 3 reply threads


granvillemsp

March 15, 2016 at 6:14 am

Hi!
My question:
Is there an action hook attached to the “proceed to registration” button that can be used to run a custom function? Or some other access point to accomplish what I’m looking for?

Here is why I am asking. I want to add some custom functionality to EE. I am going to meet with a programmer. I want to (1.) Know that I am asking something that is possible – they are not currently familiar with EE. (2) speak semi-intelligently to them 3. I feel like if I can tell them, (a) yes, there is an action hook (name or location to find it) that can be used and (b) yes it is possible to redirect (not actually proceed to checkout) to the cart or go back to the event list that they can tell me they can do it by doing xyz.

Here is what I am specifically looking to do:
We have 6 one hour events on a single day (Think wordcamp – except we want people to register for each session. So, 23 classes in EACH 1 hr session. Six 1 hr sessions in the day) We have the registration setup so far. What I am looking for is that when the registrant clicks “Proceed to Checkout” I create a custom function that verifies they have 6 items in their cart.If they do, pass go (well, really proceed to checkout as before) If they have less than 6 give a message and redirect them to either the cart or the event list.

Is this possible? If so, what would be the key parts to lead someone in the right direction?

I really appreciate your time and consideration helping me with this.


Josh

  • Support Staff

March 15, 2016 at 8:00 am

Hi there,

You may want to have them look at using the
AHEE__SPCO__load_reg_steps__reg_steps_to_load
filter hook. This will allow for adding a new step between filling out the registration form and proceeding to payment. So the new step will first verify the cart, and if all is good, move them on without stopping there. If the cart doesn’t meet the requirements, it can display your message about what to do before they can proceed.

A real world example that you can follow is how the WP User Integration add-on adds the “log in” step. There is code in the EED_WP_Users_SPCO.module.php that uses the same filter hook to add a “log in before you can continue” step. You’ll note that this step gets skipped if they’re already logged in.


granvillemsp

March 17, 2016 at 8:06 am

Josh, this is such a great help! I LOVE that you gave a real world example and looking at that code would be really handy to help us figure it out. But, we purchased the multi-event plugin and not the user integration plugin. Is there any way we can see snippets of code to see how you guys pulled it off? My programmer was able to insert a step (he created a new first step) but is having trouble grabbing the contents of the cart to check for our specific needs (1. item count 2. we are going to try to check the text string to verify they didn’t sign up for two of the same classes offered in different sessions – ie no duplicates.) I can have him provide the details if that would be more helpful- he is talking details way above my knowledge (classes/methods errors about serialized etc…) But I think if he could see how you guys grabbed the existing data that would be helpful too. Thank you SO very much for your time and help with this!


Lorenzo Orlando Caum

  • Support Staff

March 17, 2016 at 11:55 am

Hello,

Here is that file so you can take a look:

http://cl.ly/0X290o420v2X


Lorenzo

Viewing 3 reply threads

The support post ‘Is there an action hook on the Proceed to Registration button?’ 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