Skip Navigation

[Resolved] add a relationship form in woocommerce order post

This support ticket is created 6 years, 5 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.

This topic contains 2 replies, has 2 voices.

Last updated by Beda 6 years, 5 months ago.

Author
Posts
#949281

I create a relationship 1 to 1 that should connect order posts to types cpt "family-members"
Now i'd like to add it in the woocommerce checkout page - so one of the billing fields will be a realtionship to "family members"
But the problem is that if i put the relatioship form in checkout page - the order page hasn't been created yet - it will be created only after paymant done...
Is there a way to override this challenge?

#950067

still waiting.....

#950078

No, logically not, because the order exists only once it's ordered/created.

After the post exists, you can use it in a relation.
Before that post exists, you can not use it as it will not appear in any query.

What you can do is kind of "fake" the actual process, and let the user edit the Relationship form only AFTER the actual process is done already - hence, redirect from the checkout and show the form you intend to so the post you just created (order) appears to be available for a connection.

==> Note:
This is a generic situation, in all posts of all types.
If the post does not exist it cannot be used to relate.