Skip Navigation

[Resolved] cred_save_data hook

This thread is resolved. Here is a description of the problem and solution.

Problem:
When using Toolset Forms Commerce to take payment for registering a user, the cred_save_data hook is no longer helpful for triggering code after the user is created, because the WooCommerce Order needs to be processed and completed first.

Solution:
The Toolset Forms Commerce plugin comes with its own API hooks, such as cred_commerce_after_order_completed which would serve in this case.

Relevant Documentation:
https://toolset.com/documentation/programmer-reference/cred-commerce-api/#cred_commerce_after_order_completed

This support ticket is created 6 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by Aaron Zame 6 years ago.

Assisted by: Nigel.

Author
Posts
#1149819

Hi,

I'm developing a membership site, where users can sign up to be members and choose what subscription package they want and then pay online.

Because I want the members displayed on the site and abled to be searched, i've created a custom post type called member.
When a new user registers I want to use the cred_save_data hook to take the user info and create that user as a new member post.

This all works fine until I change my registration form to charge payments with this form. At the moment im just using bank transfer as the payment option. I noticed that until the order status is changed to completed the new user doesnt get created. Even after the order status is changed to completed and the new user is created the cred_save_data hook doesn't seem to get triggered anymore.

Will cred_save_data hook still work if im using charge payments on my registration form?

Cheers
Aaron

#1149850

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Aaron

The Forms Commerce plugin has its own API, and you would need to use a hook such as cred_commerce_after_order_completed in this case.

See: https://toolset.com/documentation/programmer-reference/cred-commerce-api/#cred_commerce_after_order_completed

#1150850

My issue is resolved now. Thank you!