Skip Navigation

[Resolved] How do I pull a Types field into the Woo Order details?

This support ticket is created 6 years, 7 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 2 voices.

Last updated by Christian Cox 6 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#569652

I am trying to: Use a CRED form to accept payments to submit a post to the site for a specified period of time.

Link to a page where the issue can be seen: Form is not publicly available but is located here:
Pet Listing Page: hidden link
Form: hidden link

I expected to see: When an order comes in I am not able to directly associate it with a Post so I would like to Bring over one of the custom fields to be able to tie them.

I can provide login information if you need it, but a basic front end user account can be created for free if you want to see the front end of the form.

#569823

Hi, with CRED Commerce this will be handled automatically for you. You will create a CRED form that has CRED Commerce active, which will add a product into your cart. At the same time, it will create a post which is automatically linked to the WordPress order. You can configure different settings based on the order status, for instance, the post can be in Draft status until the order is marked complete. Once complete, CRED Commerce will update that post automatically.

Please let me know if this is unclear, or if I have misunderstood your request.

#570023

Thank you for this information and I have implemented this post/payment process, my issue is that the orders are not showing any information except the billing information and the product that was purchased. Its not showing any information from the post that the form created.

How do I pull over the post title or a custom field value into the order email so that we can see which post its associated with?

#570106

I see, thanks for the details. In order to modify the WooCommerce order email, you must copy the file /wp-content/plugins/woocommerce/templates/emails/admin-new-order.php into your theme in the directory wp-content/themes/your-theme-name/woocommerce/emails/admin-new-order.php.
Add the following code to display the CRED Commerce post ID in the email:

$credCommercePost = get_post_meta($order->get_id(), '_cred_post_id', true);
 printf( __( 'CRED Commerce Post ID: %s', 'woocommerce' ), $credCommercePost ? $credCommercePost : 'N/A');

I added this code right after this line:

do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email );

Try this out and let me know if it's not working as expected for you.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.