Posted: March 30, 2023 at 3:37 pm
In my registration website I am extending the “submit registration” functionality to make some external web service calls. So I have this simple PHP… function my_custom_submit_action( $spco, $data) So my page flow: 2nd: my Registration page displays providing a form for attendee information (FN, LN, email, etc.). Then I click continue. 3rd: my Checkout/Payment page displays which provides a form for my Paypal Payments Pro credit card information. Here’s the issue. The custom submit function above is getting called after the 2nd screen submit, before the 3rd screen displays. But I can’t make the web service calls until after payment is done on the 3rd screen. So i need some code in the custom submit function to distinguish between the 2nd screen submit, and the 3rd screen submit. Something along the lines of this, a slug or something? if ( ! $checkout instanceof EE_Checkout || ! $checkout->current_step instanceof EE_SPCO_Reg_Step || ! $checkout->next_step instanceof EE_SPCO_Reg_Step ) { Can you tell me how I can distinguish between the submits ??? Thanks, Mark |
|
Hi there,
Then, in short, you’re using the wrong hook 🙂
Well, no, because What you need is to switch to a hook that fires after the finalize registration step. For example:
|
|
Tony – Using that new hook worked. But now I have another issue. When I used the other hook the code below worked to get the different objects I need from EE. Now that I have the new hook calling this code the $checkout object is Null(0). Do I need to get the checkout object another way now?, or is there a better way to get these objects that I need? function registerParticipant() // We need to get a few objects from Event Espresso // There could be more than one registration // Build a new attendee object and add it |
|
Should be passed an instance of Check what class you have within |
|
The support post ‘Question about using a custom submit action’ 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.