Skip Navigation

[Resolved] Getting user ID from _cred_post_id

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 4 replies, has 2 voices.

Last updated by Aaron Zame 5 years, 11 months ago.

Assisted by: Nigel.

Author
Posts
#1154483
screenshot1.JPG

Hi Nigel

You helped with my user registration form the other day: https://toolset.com/forums/topic/membership-registration-checkout-process/

That is all working good but my issue now is I want to update the WooCommerce email that is sent to admin when there is a new order, to include the name of the person who has registered.

I'm using my child theme to edit admin-new-order.php. This file includes the $order object. When print out the data I can see that _cred_post_id = draft_65 (see screenshot). When I check the id of the user that get created, the user id = 80.

Do you know what the draft_65 represents?

Cheers

#1154628

Nigel
Supporter

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

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

Hi Aaron

When you use Toolset Forms Commerce to charge users to register, the user doesn't actually get created until the order has completed. A 'draft' user is created in the meantime, though I'm not sure how the underlying mechanics of that work to know where you might get details of that user, I'll need to ask.

But before I do, the user only gets created when the order is processed because that's the default setting in the form. Have you tried creating the user earlier (screenshot)? Is that a viable option in your workflow? There could be some side effects depending on your set up, but maybe try it and see if it is an option for you.

Let me know.

#1158560

Sorry I thought I had replied to this.

Yes I can try creating the user earlier in the process. I didnt get your screenshot, is it just a setting in the form?

#1158634

Nigel
Supporter

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

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

Screenshot 2018-12-04 at 10.14.05.png

Sorry, I missed adding the screenshot, here it is.

It is the final setting in the form, where you could create the user before the order is processed.

#1160839

The client decided they wanted the billing details added back in.