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.
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.
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?
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.