Posted: May 21, 2019 at 1:06 pm
|
Hi there, $transaction = EE_Registry::instance()->load_model( ‘Transaction’ )->get_transaction_from_reg_url_link(); Is it possible in this to get the ticket that each person has signed up to? I need to know for my code which ticket (only two to choose from) each person selected. |
Hi, You can get the ticket name with some code like this that loops through the registrations and gets the ticket names. Since you already have the transaction:
|
|
|
thank you Josh! appreciate the hard work you put into EE! worked like a charm. I had another question about the registration form itself… I’m trying to use Jquery to determine when a dropdown in the user registration form is selected. There is one dropdown per attendee with an id as follows: $(‘#ee_reg_qstn-4029-13’).change(function() { The problem is every time a new registration occurs, the 4029 changes (obviously linked to the registration ID). What is the best way to get this value and the id for all the questions for that atendee and apply a “change” to the dropdown. Im using the add_action( ‘AHEE__attendee_information__reg_step_start’, ‘eea_custom_validation’ ); for this step. |
Just noting that the For the above question, you could just use the class assigned to each question – |
|
|
Tony, thanks so much for the reply! worked great! My question now would be, this dropdown selection would effect the other questions for that attendee… so how would I then find all the questions for that attendee when this dropdown is selected? so I use |
The method will be passed the element that changed, which will effectively become this and you can then work with the current element. It will have an ID of So you can use JS within the function to break down the ID and pull the reg_ID value, then search for all reg questions with that reg_ID in the ID to do whatever you prefer. Unfortunately, walking through how to JavaScript is outside the scope of Event Espresso support, you would be best contacting a developer familiar with JS to help with this. |
|
|
Hey Tony! Thanks man, I got the javascript covered, so was able to get the code working with your recommendation straight away.. can’t believe I didn’t think of it sooner! thanks Tony. But now my last question… how would I get the answers to custom questions for each attendee? I’ve tried looking online, but there are so many varied answers that I’m not sure of the best route for this to work.. |
You’ll need to provide more context with this. For example, what object do you have currently? I’m guessing an Do you want all of the questions for a registration or answer to specific questions? In either case you can use our model system to pull the questions/answers: https://github.com/eventespresso/event-espresso-core/tree/master/docs/G–Model-System Learning how the models work will enable you to pull pretty much any data you need but it does depend on where you are running the code and what you already have as to how deep you need to go. |
|
The support post ‘Get Ticket Name for Successful transaction’ 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.