Support

Home Forums Event Espresso Premium Update Primary Attendee and Billing Information on Checkout

Update Primary Attendee and Billing Information on Checkout

Posted: December 2, 2018 at 4:01 pm


ARAGATO

December 2, 2018 at 4:01 pm

I have created a new offline payment method. It does not use any billing form (generate billing form returns null) and it also does not use a gateway. As simple as it gets for a payment method. Registration works (approved by default), transaction incomplete, because no payment etc.

However, during checkout, when the registration and its corresponding transaction is created, I would like to do two things:

1) Update the primary contact (presumably the primary attendee for that registration?) from custom user meta fields for the current user.
2) Add billing information to that particular transaction which was just created also from custom user meta fields for the current user.

Screenshot:
http://uploads.aragato-server.net/screenshots/201812025bb9ec49ed.png

Questions:
1) Which hook would be best suited to add this kind of information? I found this hook, but I think it is probably not the right one (AHEE__EE_Transaction_Processor__update_transaction_and_registrations_after_checkout_or_payment)
2) How update the primary contact?
3) How to add billing information to the transaction?


Tony

  • Support Staff

December 4, 2018 at 2:19 am

1) Which hook would be best suited to add this kind of information? I found this hook, but I think it is probably not the right one (AHEE__EE_Transaction_Processor__update_transaction_and_registrations_after_checkout_or_payment)

That hook is ‘fired’ after a checkout has been finalized or a payment received, in your post above you have:

However, during checkout, when the registration and its corresponding transaction is created, I would like to do two things

If you want the above to happen when they are created then the above hook is way later than that but…. it depends if you want these updates to happen only when a payment is made/checkout is finalized or not?

There’s not enough info to know exactly which hook you need, but AHEE__EE_Single_Page_Checkout__process_attendee_information__end sounds like it might do what you need. The WP user integration add-on uses that hook to do some processing so I recommend taking a look at how that updates the user/contact and go from there.

2) How update the primary contact?

Pull the primary contact from the primary registration, update the details you want then run the save() on the contact object.

3) How to add billing information to the transaction?

Billing information is stored as attendee meta linked with the payment method used, take a look HERE.


ARAGATO

December 4, 2018 at 1:18 pm

Thanks.

AHEE__EE_Single_Page_Checkout__process_attendee_information__end did a fine job for updating the primary contact. The codebase from WP user integration add-on helped a lot, too

Adding billing information I used AHEE__Single_Page_Checkout__after_payment_options__process_reg_step which provides me with all the necessary checkout objects. The code from attendee.class helped as well.

Solved.

The support post ‘Update Primary Attendee and Billing Information on Checkout’ 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