Skip Navigation

[Resolved] Is there a way to automatically connect the registration and the order.

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

Problem:

Setup one-to-one post type relationship between post types "Order" and "Puppy Registrations" after user complete the Woocommerce order.

Solution:

It needs custom codes, see details here:

https://toolset.com/forums/topic/is-there-a-way-to-automatically-connect-the-registration-and-the-order/#post-1224287

Relevant Documentation:

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

This support ticket is created 5 years, 10 months 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by sarahK-2 5 years, 9 months ago.

Assisted by: Luo Yang.

Author
Posts
#1223707

Luo,

Thanks so much for your reply. I have this working now and its very helpful. One last step I need to figure out is this:

After a customer fills out the registration they are taken to the checkout. From there they fill out the information and purchase. Is there a way to automatically connect the registration and the order. Currently I have to go in to each order in woocommerce and manually connect them with a registration and that is going to not work well for these purposes.

Thanks!

#1223710

Hello,

I can get your website credentials in previous thread:
https://toolset.com/forums/topic/connecting-toolset-form-and-data-with-woocommerce-products-and-orders/#post-1221689

Please elaborate the question with more details:
Which one is the registration form? Where and how can I see it in your website?

How and where do you want to automatically connect the registration and the order?

#1224067

Here is how you can see the issue I want to resolve:

hidden link - This is post form 1066

After you register you can see it takes you to the checkout page with only that product in your cart. You pay for the class and then we have an order under woocommerce and a registration under "puppy registrations".

I have built a view from the help you gave with the other ticket :

hidden link

The order/registration info will not show up there properly unless I go into the woocommerce order and connect the registration down at the bottom.

If you go into woocommerce - orders you will see the dilemma:

An example of on that is not connected (this is how it looks when I do nothing) is order 1630

An example of an order I have connected is order 1502.

If you look at the orders on my view you can see why I need them to be connected.

I would like to do something here so that these are connected automatically when the payment form is submitted.

Thanks so much for your help!

#1224287

Thanks for the details, I assume we are talking about this URL:
hidden link

section "Order Puppy Registration"

You are going to setup one-to-one post type relationship between post types "Order" and "Puppy Registrations" after user complete the Woocommerce order.

If it is, there isn't such a built-in feature within Toolset form plugin, you might consider custom codes, for example:
1) After complete the Woocommerce order, use action "cred_commerce_after_order_completed" hook to trigger a PHP function
https://toolset.com/documentation/programmer-reference/cred-commerce-api/#cred_commerce_after_order_completed
2) In this PHP function, connect the "Order" post with "Puppy Registrations" post
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_connect_posts

#1232293

My issue is resolved now. Thank you!