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

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Related documentation: Front-end Content Submission and Editing Forms

This topic contains 3 replies, has 2 voices, and was last updated by  Christian Cox 2 months ago. The support staff assigned to this topic is Christian Cox.

Viewing 4 posts - 1 through 4 (of 4 total)
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

Christian Cox
Forum moderator

Supporter languages: English (English )

Supporter Timezone: America/New_York (GMT-05:00)

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

Christian Cox
Forum moderator

Supporter languages: English (English )

Supporter Timezone: America/New_York (GMT-05:00)

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.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘[Closed] How do I pull a Types field into the Woo Order details?’ is closed to new replies.