Skip Navigation

[Resolved] Convert an enquiry custom post to order custom 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.

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

Last updated by Nigel 6 years, 5 months ago.

Assisted by: Nigel.

Author
Posts
#1114082

Dear Sir/Madam,

Woocommerence cannot meet my requirement. I have two custom posts, "enquiry" and "order", how can I duplicate or convert the enquiry post to an order post? Of course, I need to combine several custom fields from enquiry post and save it as the post content to the order post, adding other additional information to the order post while converting. I will make a Views to show all enquiry posts and having button to process the conversion.

Best regards,

Kelvin.

#1114460

Nigel
Supporter

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

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

I'm not quite sure I understand.

I can't quite tell if you want to stop using WooCommerce orders, or you want to stop using an "enquiry" custom post type and convert the existing enquiry posts into WC Orders?

Converting posts from one type to another is just a matter of changing the post_type entry in the wp_posts table for each post.

You could write a script to do that, or you could use this plugin which you would just need to do once: https://wordpress.org/plugins/post-type-switcher/

The custom fields that existing on the source post type would still exist on the target post type. But you don't want that?

#1114469

Dear Nigel,

Sorry for my unclear information. A customer makes the enquiry, and we will review the enquiry and then quote the price to the customer. We want to copy the content from the enquiry custom post to another similar post type "order" or we call this as "purchase order" if "order" is mixed up with Woocommerence order, of course, the order post may consist part of the enquiry custom fields' content and also the amount and other additional data.

How can I copy the content from enquiry post to the order post? Can I place the content as a Woocommerce product's remark but I can change the amount of the Woo order and the go process the check out progress?

Best regards,

Kelvin

#1114993

Nigel
Supporter

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

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

Hi Kelvin

It sounds like you are registering an order post type, that is not the same as the WooCommerce order post type, and you want to copy the details from an enquiry post to a new order post.

What do you intend to trigger copying content from the enquiry post to the order post?

Toolset doesn't provide tools for customising the admin pages.

I can envisage running some code when a Toolset Form is submitted on the front end, for example. On the back end you could maybe use the save_post hook to check when an enquiry post is saved if some condition is met (e.g. a checkbox field is checked) to trigger some code to create a duplicate post but as an order post type.

I don't understand your last remarks.

If you create your own order post type then there won't be any WooCommerce checkout process.